There are two short assignments in this lab on inputting and outputting data. They are all due on Monday, August 14th at 11:59 pm. As always, please let me know if you have questions!!
Assignment 1: Write a program named SumThree.java (public class SumThree). This program will ask the user to input three doubles, then print out the sum of the three doubles which they entered. Here is an example of what your program might look like when you run it:
Type in a number:
>12 //user inputs
Type in another number:
>13.5
Type in another number:
> -5
These numbers sum to 20.5
Submit SumThree.java to your named google drive folder.
Assignment 2: Write a simple program named ATM.java (public class ATM). This program will simulate the world's worst ATM. First it will ask the user to type in his/her age (an int). Then it will ask the user how much money is in his/her bank account (a double) and how much they wish to withdraw. The program will store these three inputs as variables, subtract the amount to withdraw from the balance, and then subtract $2 from the amount of money in the account (some ATMs charge you to check your balance). It should then print out the user's age and the new balance.
After that, have it print out a rough sketch of your bank using println() or print() statements.
So it should look something like this:
Welcome to Big Borish Bank. How old are you?
> 16 //this is what the user is typing in
How much money is in your bank account?
> 9834.19
How much do you want to take out?
> 10
After my two dollar fee, you are a 16 year old chump with 9822.19 dollars in the bank.
/==BBBANK=====\ //feel free to make your bank look better or worse than mine
| | | |
| $|__|$ "" |
Submit ATM.java