Академический Документы
Профессиональный Документы
Культура Документы
3. Cheeseburger
Create a program that asks the user how many burgers they want, and then figures out
the cost after taxes.
The price of a cheeseburger is $4.
The tax is 14% (0.14).
total = mealTotal * tax;
Based on what the user inputs, determine the cost and provide appropriate output.
5. Higher or Lower
Create a guessing game (similar to yesterdays assignment). In this game, your program
will generate a random number from 1-100 and the user will have 5 chances to guess
the number. Your program will track the number of guesses, the number of wins and the
number of games the user has played by displaying and updating those stats on the
form.
Using if/else statements, you will tell your user if their guess is higher or lower than the
actual number by displaying an arrow image and updating how many turns the user
has left.
*You may need to declare certain variables in the partial class.
6. Calculator
Create a calculator! You have already created one in the past, but now you will building
off that idea and create something that looks like this:
char operation = +;
b. To turn a String into a Double, you will use Double.TryParse(string, double). You
will need to do this when your program is making calculations (when you hit
Enter). For example, you will have string of the number the user wants to
calculate (operand1), and you need to turn that into a new double variable
(number1).
Examples:
Using the char variable and assigning the first number to be calculated (saving it for
later).