Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

Assignment No. 05
Semester: Spring 2012

CS201: Introduction to Programming

Total Marks: 20

 

Due Date:05/07/2012

 

Instructions:

Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:

 

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • Assignment is copied(partial or full) from any source (websites, forums, students, etc)

 

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files, no reward will be given in any case.

 

 

Objective:

 

The objective of this assignment is to provide hands on experience of:

 

  • Using manipulators in C/C++
  • Overloading stream insertion and extraction operators

 

 

Guidelines:

 

  • Code should be properly indented and well commented.
  • Follow C/C++ rules while writing variable names, function names etc
  • Use only dev-C++ for this assignment.

 

 

 

 

 

 

 

 

 

 

 

Assignment  

 

 

Problem Statement:     Customer Bill Information     

 

Write a program that takes customer’s information from user i.e. name, ID and spending and displays the same customer information plus total bill on the screen. You will use the same Customer class implemented in Assignment#3. You need to overload stream insertion and stream extraction >> operators for the Customer class.

 

Detailed Description:

 

  • Use the same Customer class you implemented in Assignment#3.
  • This time you don’t need the friend function for calculation of total bill according to spending.
  • You can modify the class (add or delete some functions) as per program requirement.
  • You will overload extraction operator >> for getting input for an object of Customer class.
  • You will also overload insertion operator for displaying the customer information on screen.
  • On calling extraction operator in main() e.g. cin>>obj where obj is an object of Customer class, information about customer name, ID and spending should be taken from the user.
  • Take a look at the sample output for better understanding.

 

 

   

 

 

 

 

 

 

 

 

  • On calling insertion operator in main() e.g. coutobj, the output in the following format should be displayed.

 

 

 

 

  • You must use the formatting manipulators setw() and setfill() for formatting the text as shown in the output.
  • All the formatting of text should be implemented inside overloaded function for extraction operator
  • The main() function of your solution should contain only these instructions

 

    Customer obj;

    cin >> obj;

    cout obj;

    system(“pause”);

 

Views: 1973

Attachments:

Replies to This Discussion

sir ke kuch nahi ye tu kude kahey say copy kartey hi

solution hai ni hai but bannna paray ga 

To plz tahir bhai bnain na????

i will upload solution file on or before grace day IA

O sir g plz pehle hi kr dein kyn end pe dal rahein hein. load shedng ki waja se pehle hi bari mushkil hy kam krne mein

pagal bana raha hi abhi tak kahi aur update nahi howa solution

jab ho ga tu ye bhai kardey gey

sir send me 5th assignment solution of cs201

please very body be patient yr jb tahir bhai ny kha hy k ho jay ga to Q tension laity ho. 

1 day left plz send the solution

yar wo mota kaha gaya jis key hatgey thi

UPLOAD the solution plz ..............light bohat ja rahi hai....cant work!!

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service