Question: I dont know how to code this assignment? I am given two zip files but I have no idea how to begin! Objectives: Continue practicing
I dont know how to code this assignment? I am given two zip files but I have no idea how to begin!



Objectives: Continue practicing past concepts Practice building basic C++ classes Practice building C++ classes that use inheritance Assignment: For this lab you will be given a driver file (main.cpp) and two text files (potatoList.txt and appleList.txt) that will be testing classes that you should create. You should not change any of these files. (Note: For your main.cpp -- feel free to comment out portions in development if you don't have a particular class working yet. For changes, we are referring to changing what a particular line actually does/how it does it.) Your job will be to create the classes that will enable this main file to work. There should be three classes: Inventory (base class) Apple (derived class) Potato (derived class) Once you create your classes and are finished, the final project should statically print out what is contained in the code execution portion. That is how you know that you have completed the program. The classes you should create are outlined below in UML Class diagrams. For a UML class diagram cheat sheet, refer to the last page of the lab assignment details. UML Specifications: Inventory: o getItem Total (int quantity) - returns the item's price multiplied by the parameter quantity o is Organic() - acts as a standard getter o setOrganic(int flag) - takes in an integer -- if the integer is 1 organic should be true, else if the integer is 0, it should be false getters/setters - act as usual Apple O Apple() - standard empty constructor -- takes all items and sets them to their empty counterparts (for strings, O for numbers -- false for booleans); statically sets itemName to "Apples" Apple(with parameters) - takes in user parameters to set apple and inventory data equal to; statically sets itemName to "Apples" For organic: see setOrganic standards above o getters/setters - act as usual Potato o Potato() - standard empty constructor -- takes all items and sets them to their empty counterparts("" for strings, O for numbers -- false for booleans); statically sets itemName to Potatoes" Potato(with parameters) - takes in user parameters to set apple and inventory data equal to; statically sets itemName to "Potatoes" For organic: see setOrganic standards above o getPotato Total(float weight) - returns the weight parameter multiplied by the price of the potato o getters/setters - act as usual Inventory Apple Potato -type: string - orchardLocation: string -type: string #itemID: string # itemName: string # stock: int #price: float #organic: bool + Potato) + Potato(string type, string itemID, int stock, float price, int flag) + Apple + Apple(string type, string location, string itemID, int stock, float price, int flag) + getType(): string + getOrchard Location(): string + setType(string type): void +setOrchardLocation(string location): void + getitemIDO: string + getitemName(): string + getStock(): int + getPrice(): float + isOrganic(): bool + setitemID(string itemID): void + setStock(int stock): void + setPrice(float price): void + setOrganic(int flag): void + getItem Total(int quantity): float + getType(): string + setType(string type): void + getPotato Total(float weight): float Code Execution: Successful file opening. ***STOCK BEFORE CHANGES*** We have the following items in stock: Item: 0001 568 Idaho Potatoes at 0.33 per lb Organic: no Item: 0002 67 Sweet Potatoes at 0.97 per lb Organic: yes Item: 0003 32 Golden Potatoes at 0.57 per lb Organic: no Item: 0004 345 Fuji Apples at $0.66 per item Sourced from: Salt Lake City, UT Organic: yes Item: 0005 53 Pink Lady Apples at $0.92 per item Sourced from: Boise, ID Organic: yes Item: 0006 345 Red Delicious Apples at $0.4 per item Sourced from: Detroit, MI Organic: no ***STOCK AFTER CHANGES*** We have the following items in stock: Item: 0001 456 Idaho Potatoes at 0.33 per lb Organic: no Item: 0002 67 Sweet Potatoes at 1.99 per lb Organic: yes Item: 0003 32 Purple Potatoes at 0.57 per lb Organic: yes Item: 0004 345 Granny Smith Apples at $0.66 per item Sourced from: New York, NY Organic: yes Item: 0005 53 Pink Lady Apples at $0.92 per item Sourced from: Boise, ID Organic: yes Item: 0006 345 Red Delicious Apples at $0.45 per item Sourced from: Detroit, MI Organic: no ***MISCELLANEOUS*** Buying 44 Pink Lady Apples will cost $40.48 Buying 134lbs worth of Idaho Potatoes will cost $44.22
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
