0% found this document useful (0 votes)
2 views1 page

Pf Assignment

The document contains a C++ program that calculates the net price of a novel based on user input for the price and estimated copies sold. It offers three options for calculating the net price, with different discount rates applied depending on the user's choice and the estimated sales figures. The program uses a switch statement to handle the different options and outputs the calculated net price or an error message for invalid input.

Uploaded by

talhamalick17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Pf Assignment

The document contains a C++ program that calculates the net price of a novel based on user input for the price and estimated copies sold. It offers three options for calculating the net price, with different discount rates applied depending on the user's choice and the estimated sales figures. The program uses a switch statement to handle the different options and outputs the calculated net price or an error message for invalid input.

Uploaded by

talhamalick17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<iostream>

using namespace std;


int main(){
int a;
int price;
int Novel_net_price;
int estimated_sold;
cout<<"per novel price=";
cin>>price;
cout<<"Entimated novel copy sold=";
cin>>estimated_sold;
cout<<"Enter 1 for First Option And 2 for Second Option 3 for Third option:";
cin>>a;
switch(a){
case 1:
cout<<endl;
break;
case 2:
Novel_net_price=price*0.125;
cout<<Novel_net_price;
break;
case 3:
if(estimated_sold<=400 && estimated_sold>=0){
Novel_net_price=price*0.10;
cout<<Novel_net_price;
}
else if(estimated_sold>400){
Novel_net_price=price*0.14;
}
else{
cout<<"Enter the right amount";
}
break;
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy