Question
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
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
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