Sponsored Links


Results 1 to 1 of 1

Thread: cs201 Introduction to Programming Assignment No. 03 Semester Spring June 2012

  1. #1
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578

    18 cs201 Introduction to Programming Assignment No. 03 Semester Spring June 2012

    Sponsored Links1


    Assignment No. 03
    Semester: Spring 2012

    CS201: Introduction to Programming



    Problem Statement: Calculating customer’s bill using classes



    You are required to write a program for calculating the bill of a customer according to the amount spent on shopping. A customer will be an object of a class. Each object has a name, customer ID and amount spent on shopping, as its data members. You will calculate the total bill by adding tax in the spending and subtracting discount offered according to spending.

    Sponsored Links



    Detailed Description:



    You are required to create a class named Customer.

    It will have name, customer-ID and spending as its private data members.
    You have to make two constructors for this class, i.e. default constructor and parameterized constructor.
    Default constructor will initialize the name with “No name”, customer-id with “0” and spending with “0”;
    Parameterized constructor will take three arguments i.e. name, customer-id and spending.
    Create getter and setter functions for each data member of the class.
    A friend function will calculate the total bill for each object of class Customer, passed to it as argument.
    If total spending is less than 5000, then tax added on total spending is 5% and discount is 1%. If spending is more than 5000 and less than 10,000 then 10% tax and discount is 2% and if spending is more than 10,000 then 15% tax and 3% discount is applicable.
    Remember that all this calculation will be done inside friend function.
    In the main() function, create three customer type objects by using new operator. Initialize first object with default constructor, second with parameterized and take input from user for third object (use setter functions to set third object’s values taken from the user).
    Calculate total bill for all three objects by passing them to friend function and then display the result of calculation as shown in example output.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 06-24-2013, 10:39 PM
  2. Replies: 0
    Last Post: 06-30-2012, 04:41 PM
  3. Replies: 0
    Last Post: 06-21-2012, 04:26 PM
  4. Replies: 4
    Last Post: 04-14-2012, 09:30 PM
  5. Replies: 2
    Last Post: 11-20-2010, 08:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft