Thursday, 5 February 2015

Commission Program using nested if

Leave a Comment
/*
Using the following chart, write an if/else if statement that assigns
.10, .15, or .20 to commission, depending on the value in sales.
Sales Commission Rate
Up to $10,000 10%
$10,000 to $15,000 15%
Over $15,000 20%
*/
#include<iostream>
using namespace std;
void main()
{
int sales =0;
cout<<"Enter Sales = ";
cin>>sales;
if(sales<10000)
{
cout<<"Commission Rate is == 10%"<<endl;
}
else if(sales>=10000||sales<15000)
{
cout<<"Commission Rate is == 15%"<<endl;
}
else
{
cout<<"Commission Rate is == 20"<<endl;
}
}
If You Enjoyed This, Take 5 Seconds To Share It