Object Oriented problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrshafiullah
    New Member
    • May 2010
    • 2

    Object Oriented problem

    Write a C++ program that will find out the total amount of a customer's bill according to the items he or she has purchased.

    Create two classes:
    Purchased_item,
    Bill

    The Purchased_item should be having the following data members

    item_num //for item number

    note: item_num //should be static. This data member will be used to display the item number whose information is currently required from the user

    price //for per unit price
    quantity //for quantity purchased

    class Bill should have two data members

    total_amount //for the total amount of bill that is to be paid
    items[5] //an array of purchased_item; should be 5 in size

    class Bill should also have a member function that is used to calculate the total amount and assign it to the data member , total_amount


    Your program should take input of the price and quantity of 5 items and display the total amount after calculation.
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    Go elsewhere PAL to solve this problem...
    no one's gonna help you out here in homeworks...

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Bytes has a policy regarding assisting students with their homework.

      The short version is that the volunteers here can't help you with schoolwork.
      A) We don't know what material you have and have not learned in class.
      B) We don't know the guidelines you must follow.
      C) In the long run giving you the answers actually short changes your education.

      Hint 1: Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.
      Hint 2: Your text book
      Hint 3: Your instructor
      Hint 4: Posting guidelines regarding homework assignments.

      TIP: Read through the MSDN Library about each new control/method/area you are learning.

      Comment

      Working...