Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 6 points ) Write a C + + program named hw 1 _ 1 . cpp that reads two integer numbers from a user

(6 points) Write a C++ program named hw1_1.cpp that reads two integer numbers from a user and displays the sum, average, and product. The following shows a sample execution of the program. When the instructor runs your program for grading, your program should display the same result as the sample execution, including spaces. Note that the boldfaced numbers (4 and 6 in this case) are entered by the user. Thus, you could also enter 23, and should return appropriate results.
Enter two integers: 46
You entered 4 and 6.
4+6=10
4+62=5
4**6=24
(6 points) Suppose a worker who works for a company has received a 7.6% pay increase next year. Write a C++ program named hw1_2.cpp that takes the worker's current annual salary as input, and outputs the amount of salary increase, the new annual salary, and the new monthly salary. Note that when you display the output, you have to display the money amount correctly (i.e., two digits after the decimal point). The output should look as follows:
Enter your current salary =>10000
Salary increase: $760.00
New annual salary: $10760.00
New monthly salary: $896.67
If you want to print out two decimal places, you can use these three lines of code before printing out monetary values:
cout. setf(ios: : fixed);
cout. setf(ios: : showpoint);
cout.precision(2);
3.(8 points) Write a C++ program named hw1_3.cpp that allows the user to enter a number of cents. Then the program outputs the value in terms of quarters, dimes, nickels, and pennies. The output should look as follows. Again, when the instructor runs your program for grading, your program
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions