Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in C++ HW_3 (a, b, c) -_(3 parts) HW_3a - Create a new project and .cpp file Your program should do the following Declare

image text in transcribedimage text in transcribed

write in C++

HW_3 (a, b, c) -_(3 parts) HW_3a - Create a new project and .cpp file Your program should do the following Declare a constant global variable of float data type. Name it: TAX_RATE Remember, constant variables should be all uppercase o Assign it a value of: 0.07 o Prompt the user for January sales Read in January sales Note: When a program deals with money, Prompt the user for February sales use float or double variables. Read in February sales Prompt the user for March sales Read in March sales The program should then compute the total sales for all three months The program should then compute the amount of tax for the total sales The tax is equal to the total sales times the tax rate. (Use the TAX_RATE variable in the expression). Output the amount of tax to the screen as shown in the following output: The output should be formatted to output decimal numbers (not scientific notation). The output should show the decimal point and trailing zeros(like: 22.00). The output should be formatted to two places to the right of the decimal point. The output should show the dollar sign before each number. /* OUTPUT Enter January sales: 1101.55 Enter February sales: 2321.22 Enter March sales: 3313.12 o o o Total sales for the first three months is $6735.89, and the amount of sales tax is $471.51 Press any key to continue /* HW_3b - Create a new project and .cpp file Your program should do the following Prompt the user for the first number(int data type) Read the first number. Prompt the user for the second number(int data type) Read the second number Write code to calculate the quotient and remainder when the first number is divided by the second number. Make sure to used variables in your output statements. /* OUTPUT Enter the first number: 126 Enter the second number: 31 126 divided by 31 equals 4 with a remainder of 2. Press any key to continue */ HW_3c - Create a new project and .cpp file Your program should do the following Prompt the user for the base value (double data type) Read the base value. Prompt the user for the exponent value_ (int data type) Read the exponent value The program should use a function to calculate the base raised to the exponent. (see output) The program should use a function to calculate the square root of the base. Format the output to two places to the right of the decimal. (see output: 1.73) The following output should be displayed on the screen: o /* OUTPUT Enter the base: 3 + The user enters 3 Enter the exponent: 2 f The user enters 2 3 to the 2 power equals 9. The square root of 3 equals 1.73 Press any key to continue */ Note: For all 3 parts, include an information section at the top of each program. (See syllabus) Include your name, class, and homework in comments. Make sure to include the separator lines as shown in the syllabus. Copy and paste the output below your source code. Classroom: Staple all 3 parts of HW_3 (3a, 3b and 3c). NOTE: UNSTAPLED HOMEWORK will not be accepted. Turn in a copy of your source code and output at the beginning of the next class. Make sure you include an information section at the top of each program. (See syllabus) Online class Submit all 3 programs BY CANVAS HW 3 (3a, 3b and 3c). (Do this for all homework for the entire semester.) IMPORTANT: FOR THE ENTIRE SEMESTER, SUBMIT YOUR HOMEWORK ON CANVAS IN A WORD DOCUMENT OR A TEXT FILE, NOT A PDF OR IMAGE

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

4. Do you feel you did the best scholastic work you are capable of?

Answered: 1 week ago

Question

=+ What topics are contained in the contracts?

Answered: 1 week ago