A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the sub total of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent. P.S. must be shown in psuedocode.
1 answer:
What language are you programming in? <span>If you are programming in C or C++, you could do something like this: </span> <span>#include <iostream> </span> <span>using namespace std; </span> <span>int main(void) </span> <span>{ </span> <span>//declarations </span> <span>double item1 = 0; </span> <span>double item2 = 0; </span> <span>double item3 = 0; </span> <span>double item4 = 0; </span> <span>double item5 = 0; </span> <span>double subtotal = 0; </span> <span>double total = 0; </span> <span>double tax = 0; </span> <span>//Enter Items </span> <span>cout << "Please enter the price of item 1"; </span> <span>cin >> item1; </span> <span>cout << "Please enter the price of item 2"; </span> <span>cin >> item2; </span> <span>cout << "Please enter the price of item 3"; </span> <span>cin >> item3; </span> <span>cout << "Please enter the price of item 4"; </span> <span>cin >> item4; </span> <span>cout << "Please enter the price of item 5"; </span> <span>cin >> item5; </span> <span>//Compute subtotal </span> <span>subtotal = (item1 + item2 + item3 + item4 + item5 + item6); </span> <span>//Compute amount of tax </span> <span>tax = subtotal * (.06); </span> <span>//Compute total </span> <span>total = subtotal + tax; </span> <span>//Display subtotal, total, and amount of tax </span> <span>cout < " The subtotal of the sale is: " << subtotal << endl; </span> <span>cout < " The amount of sales tax is: " << tax << endl; </span> <span>cout < " The total of the sale is: " << total << endl; </span> <span>return 0; </span> <span>}//end of function main </span> <span>I know this is a very very basic C++ program but I hope it helps and good luck on your project!</span>
You might be interested in
Answer:
gggvhhdgjhgfggdhhghbvvvb vnnsdvbgugc
operating system software and application software
Answer:
which type of questions is this
Answer:
it's business
Explanation:
business you started with small and work for it grow up.