Take quantity and price from the user.
Calculate the total payment ( payment = quantity * price ).
Display the quantity, price and payment.
Repeat the program as long as the user key in ‘1’.
Use while loop for this question.
1
Expert's answer
2012-04-20T07:22:18-0400
#include <iostream>
#include <conio.h>
using namespace std;
int main(int argc, char *argv[])
{
int quantity = 0;
int price = 0;
int payment = 0;// = quantity * price
char ch = '1';
//Repeat the program as long as the user key in ‘1’.
while(ch == '1')
{
cout << endl;
cout << "Enter Quantity:";
cin >> quantity;
cout << "Enter Price:";
cin >> price;
//Display the quantity, price and payment.
payment = quantity * price;
cout << "Quantity: " << quantity << endl;
cout << "Price: " << price << endl;
cout << "Payment: " << payment << endl << endl;
cout << "Do You want repeat?(press '1' to continue) ";
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment