McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Life Long Learning
Data Files
The Buzz in IT
Ask the Author
Did You Know
Purchasing
Cool Web Sites
I-Witness
Interactive Companion
Did You Know
Crossword
Glossary
Animations
Level 2 #3
Level 2 #5
Mixed Quiz
Feedback
Help Center


I-Series Computing Concepts
Stephen Haag, University of Denver
Maeve Cummings, Pittsburg State University
Alan I Rea, Jr., Western Michigan University

Computer Programming

Level 2 #3

QUESTIONS AND EXERCISES #3 (p. 11.33)

Problem/Opportunity Statements

a. Create a program that accepts a number between 1 and 100.

Multiply that number by 2 until the number gets as close to 1,000 as possible, but doesn't go over 1,000.

Output the result.

b. Create a program that asks a user for his/her name and birthday. The program should also get today's date from the computer system.

If today is the user's birthday, wish him/her a happy birthday on the computer screen.

If today isn't the user's birthday, do nothing.

c. Create a program that asks a user for his/her name, e-mail, and birthday. The program should also get today's date from the computer system.

If today is the user's birthday, wish him/her a happy birthday on the computer screen.

If today isn't the user's birthday, calculate how many days are left until his/her birthday. Send him/her a virtual card one week before his/her birthday.

d. Create a program that gets a credit card applicant's name, co-applicant's name (if any), address, and annual income.

If an applicant makes over $100,000 a year, approve the credit card application. If an applicant makes between $50,000 and $100,000 a year, approve the application if there is a co-applicant. If the applicant makes between $30,000 and $50,000 a year ask them to speak to an account manager. If the applicant makes less than $30,000 a year, deny the application.

Send immediate results to the applicant via the computer screen. Provide any additional information, such as account manager contact information, if necessary.

e. Create a program that accepts input from a weather station. The program accepts temperature and precipitation data.

Test the following conditions and provide specific output to a Web page according to the criteria met:

TEMPERATURE

PRECIPITATION

WEB PAGE OUTPUT

Below 32 o F

No

You should wear a parka.

Below 32 o F

Yes

You should wear a parka and snow boots.

Above 32 o F but below 60 o F

No

You should wear a coat.

Above 32 o F but below 60 o F

Yes

You should wear a coat and bring an umbrella.

Above 60 o F

No

Get out and enjoy the day.

Above 60 o F

Yes

We need the rain, right?

 

 

f. Create a program that gets an employee's identification, pay rate, and number of hours worked in one week.

Assume that employees are hourly workers.

If an employee works over 40 hours in a week, calculate for overtime pay (1.5 * hourly wage). No employee can work over 80 hours in one week. No employee can earn less than $10 an hour or more than $75 an hour.

Send the weekly payroll totals in a file to the Payroll department so they can calculate benefits and print the paychecks. Make sure that this software's output is portable to the Payroll software.





McGraw-Hill/Irwin