5

Name, Age, and Salary

 2 years ago
source link: http://programmingbydoing.com/a/name-age-and-salary.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Name, Age, and Salary
  • Author: Graham Mitchell
  • Filename: NameAgeAndSalary.java

Name, Age, and Salary

Ask the user for their name. Then display their name to prove that you can recall it. Ask them for their age. Then display that. Finally, ask them for how much they make and display that. 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!

©2013 Graham Mitchell

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


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK