Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ class: The program below computes the subtotal, discount, and the total cost for new computers for the ATC building. Write the prototype, call statement

C++ class: The program below computes the subtotal, discount, and the total cost for new computers for the ATC building.

Write the prototype, call statement and function definition for getData() which is to prompt the user for and input the number of computers and the price each.

Write the prototype, call statement and function definition for calc() which is to calculate the subtotal, amount of discount, and the total for this purchase. The discount rate is 5% for orders under $5,000 and 12% for orders of $5,000 or more.

Make no changes to main(). No comments are necessary.

#include #include

using namespace std;

//Function Prototypes

_____________________________________________

________________________________________________

int main() { //Variable declaration int num; //number of computers to be ordered double price; //cost each double subtotal; //cost each multiplied by number double discount; //% of subtotal double total; //subtotal - discount

//Call getData to input price each and number in order

________________________________________________

//Call calc() to compute subtotal, amount of discount & tota

________________________________________________

cout <<" SUBTOTAL: $ " << subtotal; cout <<" DISCOUNT: $ << discount; cout <<" TOTAL: $ << total;

return 0; }

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

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

Knowledge of project management (PMI) teachings

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago