Question
1. Write a program that converts an input grade from 60 to 100 and outputs a converted grade from 0.0 to 4.0. a. Minimum input
1. Write a program that converts an input grade from 60 to 100 and outputs a converted grade from 0.0 to 4.0.
a. Minimum input value is 60, maximum is 100.
b. All whole numbers must display as decimals. (0 displays as 0.0 and 3 as 3.0)
The solution requires that you create a simple mathematical expression that converts the input value into the output value.
The program should appear as follows (input in bold italics): Grade Converter --------------- Input grade (60-100): 85 Converted grade (0.0 to 4.0): 2.5 Some example values are (70 = 1.0, 89 = 2.9, 63 = 0.3, 96 = 3.6).
2. Write a program that emulates a simple shopping cart.
a. Calculate and display the subtotal, tax and total cost.
b. Use a constant variable to set a fixed tax rate of 8.875.
c. Use escape characters for column alignment.
d. Display correct dollar values (2 decimal places, use cout precision).
e. Align data using the iomanip library column width commands.
Output Example (input bold and italics): Shopping Cart -------------------- Cost of first item: $5.34 Cost of second item: $41.00 Cost of third item: $22.05 Subtotal: $68.39 Tax: $6.07 Total: $74.46
3. Write a program that converts dollars into coins.
a. Request a dollar amount as an integer (i.e. $5.34 is input as 534).
b. Use a constant variable for each coin to declare the fixed value as an integer. For example const int NICKEL = 5.
c. Use division and the mod function to calculate the number of each coin.
Output Example (input bold and italics): Change Calculator ----------------- Enter dollar amount: $534 Your change is: 21 Quarters 0 Dimes 1 Nickels 4 Pennies
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started