Starting from:
$30

$24

Laboratory #2 Solution




NOTE:




Please submit only C++ source files (*.cpp) to Blackboard.



Please put your name, project description, and date on the top of your file as a comment.
PLEASE WORK ALONE. If cheating is found, you will get ZERO.



1. (Lastname_Lab2_p1.cpp) Write a program to compute and display a person’s weekly salary as determined by the following expressions: If the number of hours worked is less than or equal to 40, the person receives $8 per hour; otherwise, the person receives $320, plus $12 for each hour worked over 40 hours. The program should request the hours worked as input and should display the salary as output.




(Lastname_Lab2_p2.cpp) Write a program to display the following two prompts:



Enter a month: (use a 1 for Jan, etc.) Enter a day of the month:




Have your program accept and store a number in the variable month in response to the first prompt and, in response to the second prompt, accept and store a number in the variable day. If the month entered is not between 1 and 12, inclusive, print a message informing the user that an invalid month has been entered. If the day entered is not between 1 and 31, print a message informing the user that an invalid day has been entered.




3. (Lastname_Lab2_p3.cpp) The interest rate paid on funds deposited in a bank is determined by the amount of time the money is left on deposit. For a particular bank, the following schedule is used:




Time on Deposit
Interested Rate
Grater than or equal to 5 years
4.5 percent
Less than 5 years but greater than or equal to 4 years
4.0 percent
Less than 4 years but greater than or equal to 3 years
3.5 percent
Less than 3 years but greater than or equal to 2 years
2.5 percent
Less than 2 years but greater than or equal to 1 year
2.0 percent
Less than 1 year
1.5 percent



Write a program that accepts the time that funds are left on deposit and displays the interest rate that corresponds to the time entered.







4. (Lastname_Lab2_p4.cpp) Each disk drive in a shipment is stamped with a code from




1 to 4, where the codes indicate the following disk manufactures:




Code
Manufacturer
1
3M Corporation
2
West Digital Corporation
3
Seagate Corporation
4
Verbatim Corporation



Write a program that accepts the code number as an input and, on the basis of the value entered, displays the correct disk drive manufacturer. (Hint: use switch)

More products