BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 2nd Semester > Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-03-2011, 02:31 PM
bonfire's Avatar
M.Arsalan Qureshi

 
Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 616
Program / Discipline: BSTS
Class Roll Number: 09-31
bonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond repute
Default Program to enter the sale value and print the agent's commission

Program to enter the sale value and print the agent's commission


#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
long int svalue;
float commission;
cout << "Enter the total sale value : " << endl;
cin>>svalue;
if(svalue<=10000)
{
commission=svalue*5/100;
cout << "For a total sale value of $" << svalue << ", ";
cout << "the agent's commission is $" << commission;
}
else if(svalue<=25000)
{
commission=svalue*10/100;
cout << "For a total sale value of $" << svalue << ", ";
cout << "the agent's commission is $" << commission;
}
else if(svalue>25000)
{
commission=svalue*20/100;
cout << "For a total sale value of $" << svalue << ", ";
cout << "the agent's commission is $" << commission;
}
getch();
}
This program takes in the total sale value as a screen input from the user.
The program then calculates the agent's commission with the help of the 'IF-ELSE' command as follows :
5% if the total sale value is less than or equal to $10000.
10% if the total sale value is less than or equal to $25000.
20% if the total sale value is greater than $25000. It then outputs the agent's commission using the 'cout' command.



Sample Input
26000
Sample Output
For a total sale value of $26000, the agent's commission is $5200

__________________

Reply With Quote
Reply

Tags
agent, commission, enter, print, program, sale


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to enter an integer and print if it is prime or composite bonfire Object Oriented Programming 1 22-11-2011 07:45 PM
Program to enter an integer and print out its successor bonfire Object Oriented Programming 0 01-03-2011 02:55 PM
Program to enter an integer and print if it is greater or less than 100 bonfire Object Oriented Programming 0 01-03-2011 02:28 PM
Program to enter your age and print if you should be in grade 10 bonfire Object Oriented Programming 0 01-03-2011 02:25 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 09:25 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.