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.
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 ratings0% 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.
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; } }