We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & 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”);

 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 1953

Attachments:

Replies to This Discussion

kuch nahi hoga light chali jaye gey

tahir bhai tu so gaye

LAST HOUR !!!!!!!!!!!! COME ON GUYS ...........UPLOAD DA solution......anyONE.???? koi to correct solution upload kr dy...

pleeeeeeeeeeeez 

RSS

Looking For Something? Search Here

HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!

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

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

.