Project 1: Write a program to determine a person’s paycheck based on their pay rate and hours worked. Assume that they are paid “time-and-a-half” for any overtime hours (they receive 1.5 times their pay rate for any hours worked over 40). Print the results as shown below.
Test Data (try both):
a)
Input:
Pay Rate = $12.43
Hours = 43
Output:
Regular Pay = $497.20
Overtime Pay = $55.94
Total Pay = $553.14
b)
Input:
Pay Rate = $13.81
Hours = 37
Output:
Regular Pay = $510.97
Overtime Pay = $0.00
Total Pay = $510.97
Project 2: Write a program that accepts the integer lengths of the 3 sides of a triangle and outputs whether that triangle is scalene, isosceles or equilateral. If the triangle is not possible, state that instead. Recall that for a triangle to be possible, the sum of any two of its sides must be greater than the 3rd side.
Test Data:
a) 3, 4, 5 = scalene
b) 3, 4, 3 = isosceles
c) 3, 3, 3 = equilateral
d) 3, 3, 8 = not possible
Project 3: Write a program that will add, subtract, multiply or divide two integers. The user will enter two integers, as shown. They will then enter the choice of operation (+, -, * or /) as a character. The program will then display the result as shown in the example below.
Sample run of the program:
Enter integer 1: 2
Enter integer 2: 5
Enter the operation (+, -, *, /): -
2 - 5 = -3
Project 4: Write a program to simulate a cash register change calculator. Allow the user to enter a purchase price of up to 100 dollars. Then determine the best change to give back for a $100 bill. Print the results to the screen as below, with no zero results displayed. Note: ignore the existence of half-dollars, $2 bills and $50 bills.
a) For a purchase price of $52.32 and a $100 bill tendered,
Your change is $47.68
------------------------------
2 $20 bill(s)
1 $5 bill(s)
2 $1 bill(s)
2 Quarter(s)
1 Dime(s)
1 Nickel(s)
3 Penny(ies)
b) For a purchase price of $37.85 and a $100 bill tendered,
Your change is $62.15
------------------------------
3 $20 bill(s)
2 $1 bill(s)
1 Dime(s)
1 Nickel(s)
Project 5: Write a program that will determine the amount of an electric bill from the number of kilowatt-hours (kWh) used. The electric company charges its customers $.0577 per kWh for the first 1000 kWh used, $.0532 for the next 4000 kWh, and $.0511 for any kWh over 5000. Use constants for these values.
Project 6: Write a program to determine the cost of parking at a pay lot based on the type of vehicle and number of hours parked. The parking lot charges the following rates: