We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

Problem Statement:

Suppose METRO Cash & Carry Pakistan has given you a task to develop an automatic checkout system in C++. All items are identifiable by means of a merchandise computer code (barcode) and the item name. Groceries are either sold in packs or by weight. Packed items have fixed prices. The price of groceries sold by weight is calculated by multiplying the weight by the current price per kilogram. As a software developer your task is to develop the classes needed to represent the products first and organize them hierarchically according to the UML diagram given on next page.

                                                                             Items

Properties:

Bar code

Item Name

Methods:

setbarCode()

getbarCode()

...

scanner()

printer()

 

 

 

 

 

 

 

 

 

                                    PackedFood                                                                                            FreshFood

 

Properties:

Price per piece

 

Methods:

getPrice()

setPrice()

...

scanner()

printer()  

Properties:

Weight

Price per rupee

 

Methods:

setWght()

getWght()

...

scanner()

printer()

 

 

 

 

 

 

 

 

 

Figure: UML for METRO Cash & Carry Pakistan

 

 

 

 

Tasks for you:

  1. Make a base class named Item then define its private and public members. Define a constructor with parameters for both data members (Barcode, Item Name). You should add default values for the parameters to provide a default constructor for the class. In addition to the access methods setCode() and getCode(), you are also required to define the methods scanner() and printer(). These methods will simply output item data on screen or read the data of an item from the keyboard.
  2. Define two derived classes PackedFood and FreshFood. In addition to the Item class data, the PackedFood class should contain the unit price. The FreshFood class should contain a weight and a price per kilogram as data members. You are required to define a constructor with parameters providing default-values for all data members in both classes. Also define the access methods needed for the new data members.

Make the main() function then test the classes in it, that creates two objects each of the types Item, PackedFood and FreshFood. One object of each type should be fully initialized in the object definition. You can use the default constructor to create the other object. The get() and set() methods and the scanner() method should be well written and the printer() method should display the items on screen.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1639

.

+ 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)

Attachments:

Replies to This Discussion

Ma aaj correct solution upload karoo ga check kar lena 

Complete Solution  with sound

https://youtu.be/6jleUtzJl7Y

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

Check CS304 Assignment # 3 solution step to step..
https://youtu.be/4KHmhKG0ctQ

Cs304 Assignment no.03

Complete and correct solution accoring to Given Task

https://youtu.be/6jleUtzJl7Y

RSS

Latest Activity

Rameesha liked + M.Tariq Malik's profile
1 minute ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MTH601 Assignment No 01 Fall 2019 Solution & Discussion in the group MTH601 Operations Research
3 minutes ago
✧Foodie✧ replied to + M.Tariq Malik's discussion ENG301 Business Communication Assignment No 01 Fall 2019 Solution & Discussion in the group ENG301 Business Communication
4 minutes ago
Profile Icon✧Foodie✧ and Hj joined + M.Tariq Malik's group
4 minutes ago
Rameesha added a discussion to the group Solution
5 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion ENG301 Business Communication Assignment No 01 Fall 2019 Solution & Discussion in the group ENG301 Business Communication
6 minutes ago
+ مسافر updated their profile
6 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion ENG301 Business Communication Assignment No 01 Fall 2019 Solution & Discussion in the group ENG301 Business Communication
7 minutes ago
Rameesha liked hira aman's discussion eng201
8 minutes ago
Rameesha replied to hira aman's discussion eng201 in the group Solution
8 minutes ago
Rameesha replied to hira aman's discussion eng201 in the group Solution
8 minutes ago
Rameesha replied to khurram ghulam rasol's discussion Who passed the 2n semester in the group Solution
10 minutes ago
Profile IconAleem, Shahzad Rizwan and Muhammad Tariq Mahmood joined + M.Tariq Malik's group
10 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MGT503 Assignment No 01 Fall 2019 Solution & Discussion in the group MGT503 Principles of Management
12 minutes ago
Rameesha joined + © Malik © Kracker +'s group
13 minutes ago
+ M.Tariq Malik replied to Aini MCS's discussion CS301 assignment solution required
13 minutes ago
+ M.Tariq Malik liked Aini MCS's discussion CS301 assignment solution required
13 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion ENG501 History of English Language Assignment No 01 Fall 2019 Solution & Discussion in the group ENG501 History of English Language
14 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion ENG501 History of English Language Assignment No 01 Fall 2019 Solution & Discussion in the group ENG501 History of English Language
16 minutes ago
Sana fatima replied to + M.Tariq Malik's discussion CS304 Assignment No 01 Fall 2019 Solution & Discussion in the group CS304 Object Oriented Programming
16 minutes ago

Today Top Members 

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

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