KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD
KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD
KING'S IT WORLD
Would you like to react to this message? Create an account in a few clicks or log in to continue.

KING'S IT WORLD


 
HomeHome  GalleryGallery  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  
Search
 
 

Display results as :
 
Rechercher Advanced Search
kings it world text ad
KINGSITWORLD CALENDAR
Follow me on G+
KINGSITWORLD WEATHER
Latest topics
» QURAN MAJEED KE TAFSEER
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeMon Aug 20, 2012 2:59 am by YOUSUFHALI

» PHY301 CIRCUIT THEORY REFERENCE BOOK
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeWed Jul 25, 2012 11:36 am by shabbir1915

» MTH202 ASSIGNMENT NO 3 SOLUVED
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeMon Jun 11, 2012 9:51 am by jaffarhussain

» Retrieve the DTC In the Jewel Module of 1995 Ford
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeThu May 31, 2012 11:51 am by obd2tool

» How you can Obvious the Check Engine Light on the
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeThu May 31, 2012 11:43 am by obd2tool

» send free sms and send free sms update on facebook
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeTue May 15, 2012 8:33 pm by rizwan269

» United Bank Limited (UBL) - Fee Deposit
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeThu May 10, 2012 3:33 pm by irumnaz

» PHOTO MIXER SOFTWARE
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeFri Apr 20, 2012 10:02 am by sacredwkb

» Entrepreneurship Survey
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeThu Mar 08, 2012 2:20 pm by Admin

» Fall 2011 Semester Result Announced
CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeThu Mar 08, 2012 2:19 pm by Admin

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
kings it world text ad
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website
visitors counter
CS304 3RD ASSIGNMENT SOLUTION Image
Powered by website analytics technology.
Keywords
term 2011 assignment HRM611 paper MGT502 MGMT611 2010 final
kings it world text ad
FLAG COUNTER
free counters
LIVE TRAFFIC

 

 CS304 3RD ASSIGNMENT SOLUTION

Go down 
AuthorMessage
Admin
Admin
Admin


Scorpio
Posts : 638
Points : 2155
Reputation : 19
Join date : 2010-05-15
Age : 36
Location : islamabad

CS304 3RD ASSIGNMENT SOLUTION Empty
PostSubject: CS304 3RD ASSIGNMENT SOLUTION   CS304 3RD ASSIGNMENT SOLUTION Icon_minitimeSat May 22, 2010 9:06 pm

Code:

//header files
#include<iostream.h>
#include<conio.h>

//class definition
class purchased_item
{
//hidden part
private:
//static data member
static int item_num;
int price;
int quantity;
//interface
public:
//constructor
purchased_item()
{
price = 0;
quantity = 0;
}
//taking input
void input()
{
int price2=0;
int quantity2= 0;

cout<<"enter price and purchased quantity of item "<< ++item_num<<endl;
cout<<"\n\t\tprice:";
cin>>price2;
set_price(price2);

cout<<"\n\t\tQuantity: ";
cin>>quantity2;
set_quantity(quantity2);
cout<<"\n";
}
//setting price
void set_price(int price1)
{
price=price1;
}
//getting price
int get_price()
{
return price;
}
//setting quantity
void set_quantity(int qty)
{
quantity = qty;
}
//getting quantity
int get_quantity()
{
return quantity;
}
//destructor
~purchased_item(){}
};

//initialize static member
int purchased_item::item_num = 0;

//class definition
class Bill
{
//hidden part
private:
purchased_item items[5];
int total_amount;
//interface
public:
//constructor
Bill()
{
total_amount = 0;
}
//taking input
void input()
{
for(int i = 0 ; i <5; i++)
items[i].input();
}
//calculating total amount
void total_amount_cal()
{
for(int i = 0; i <5; i++)
total_amount +=(items[i].get_price()* items[i].get_quantity());
cout<<"\ntotal amount to be paid is "<<total_amount;
}
//destructor
~Bill(){}
};


//main function
int main()
{
//bill object
Bill bill;
//calling input
bill.input();
//calling total_amount_cal
bill.total_amount_cal();
getch();
}
Back to top Go down
 
CS304 3RD ASSIGNMENT SOLUTION
Back to top 
Page 1 of 1
 Similar topics
-
» CS607 ASSIGNMENT SOLUTION
» assignment no 5 solution of cs4-1
» CS507 ASSIGNMENT NO 3 SOLUTION
» CS101 ASSIGNMENT NO 1 SOLUTION
» assignment no 6 solution of cs401

Permissions in this forum:You cannot reply to topics in this forum
KING'S IT WORLD :: EDUCATION :: ASSIGNMENTS-
Jump to: