Answer to Question #299836 in C++ for saim

Question #299836

Accept the marked price from the user and calculate the Net amount as(Marked Price – Discount) to pay according to following criteria:


Marked Price - Discount


>10000 20%


>7000 and <=10000 15%


<=7000 10%

1
Expert's answer
2022-02-19T16:56:51-0500
#include <iostream>
using namespace std;


int main() {
	float markedPrice;
	float netAmount;
	float discount;
	cout<<"Enter the marked price: ";
	cin>>markedPrice;


	//>10000 20%
	//>7000 and <=10000 15%
	//<=7000 10%


	if(markedPrice>10000){
		discount=0.2*markedPrice;
	}
	if(markedPrice>7000 && markedPrice<=10000){
		discount=0.15*markedPrice;
	}
	if(markedPrice<=7000){
		discount=0.1*markedPrice;
	}


	netAmount=markedPrice-discount;
	cout<<"The Net amount: "<<netAmount<<"\n";






	system("pause");


	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