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 Visio5000
PRICE - $1000
YEAR 2000
ITEM television
MODEL Samsung100
PRICE - $500
YEAR 1995
Your program must meet the following requirements:
Define a struct, itemInfo, with the following members:
item (old c-style string of size 20)
model (old c-style string of size 20)
price (float)
year (int)
DO NOT USE STRING CLASS OBJECTS IN YOUR PROGRAM
Define 2 arrays items1, items2 of 10 itemInfo
Initialize items1 with the values shown above
The program should then:
Write (or save) the two structures in items1 to a file called itemsFile
Prompt the user to enter two more items and add the items to items1 array.
Display all four array elements on the screen
Next, append the 2 new items to the file
Then, input all 4 file items into the second array items2
Display all four items in items2 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 text-mode I/O and the other using binary mode I/O

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!