Question: Write a program that will help you save inventory items in your home. Examples of items would be TVs , appliances, jewelry, furniture, paintings, computers,
Write a program that will help you save inventory items in your home. Examples of items would be TVs appliances, jewelry, furniture, paintings, computers, etc. Essentially, anything of value. The following information should be kept about each item: type, model, price, year purchased. For example, here would be information kept about two TVs:
ITEM television
MODEL Visio
PRICE $
YEAR
ITEM television
MODEL Samsung
PRICE $
YEAR
Your program must meet the following requirements:
Define a struct, itemInfo, with the following members:
item old cstyle string of size
model old cstyle string of size
price float
year int
DO NOT USE STRING CLASS OBJECTS IN YOUR PROGRAM
Define arrays items items of itemInfo
Initialize items with the values shown above
The program should then:
Write or save the two structures in items to a file called itemsFile
Prompt the user to enter two more items and add the items to items array.
Display all four array elements on the screen
Next, append the new items to the file
Then, input all file items into the second array items
Display all four items in items on the screen
Define the following functions:
inputItems prompts the user for how many to enter and then inputs new items
displayItems displays all the items on the screen
saveToFile appends or saves all of the items in the array to a file
inputFromFile reads or inputs all of the items in the file to an array
Do two versions of the program. One using textmode IO and the other using binary mode IO
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
