Problem 16

Name, Age, and Salary

  1. Ask the user for their name.
    • Then display their name to prove that you can recall it.
  2. Ask them for their age.
    • Then display that.
  3. Finally, ask them how much they make per hour
    • Display that.

Note: You should use the most appropriate data type for each variable.

Hello.  What is your name?
Dennis 
 
Hi, Dennis!  How old are you?
37 
 
So you're 37, eh?  That's not old at all!
How much do you make, Dennis?
8.50 
 
8.5!  I hope that's per hour and not per year! LOL!
Hello.  What is your name?
Catsup 
 
Hi, Catsup!  How old are you?
12 
 
So you're 12, eh?  That's not old at all!
How much do you make, Catsup?
99.9 
 
99.9!  I hope that's per hour and not per year! LOL!

◄ 15: The Forgetful Machine 17: More User Input of Data ►



Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.