Answer to Question #338657 in C++ for Kate

Question #338657

(1) Write a program that will ask for a price.



(2) If the price is greater than 1000, compute a 10% discount from the original price. Display the computed discount.



(3) If not, just display the original price.

1
Expert's answer
2022-05-08T14:32:44-0400
#include <iostream>
using namespace std;


int main() {
float price;
	cout << "Please enter price: ";
	cin >> price;
	cout << "###################################\n";
	if (price > 1000){
	   cout << "The computed discount:\t" << price * 0.1 << endl;
	   cout << "Your price:\t\t" << price - price * 0.1 << endl;
	}
	else 
		cout << "Your price: " << price;
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS