Question: Create a program to read a text file of computer inventory records and display inventory labels. Each record describes one item in inventory and must
Create a program to read a text file of computer inventory records and display inventory labels. Each record describes one item in inventory and must be stored in a struct in your program. Create functions to complete the following tasks:
read one record and store it into a struct,
format and display the information as shown in Figure 1.
Each record describes one computer and contains the following attributes in the order listed:
manufacturer - string
processor - string
RAM (GB) - integer
disk size (GB) - integer
cost - double
location - string
date acquired - struct (short, short, int)
asset tag - string
----------------------------------------
Asset Tag: 20191231-PC-021
Acquired: 03/24/2007
Cost: $1087.99
Location: 256
Manufacturer: Dell
CPU: Core i7 8700 (3.2 GHz)
RAM: 16 GB
Disk: 256 GB
----------------------------------------
----------------------------------------
Asset Tag: 20191215-PC-045
Acquired: 08/01/2010
Cost: $459.00
Location: 128
Manufacturer: HP Compaq
CPU: Ryzen 2400GE (3.20 GHz)
RAM: 8 GB
Disk: 1024 GB
----------------------------------------
Figure 1. Sample output of inventory labels
Sample File
Dell Core i7 8700 (3.2 GHz) 16 256 1087.99 KM256 2 17 2017 20191231-PC-021 HP Compaq Ryzen 2400GE (3.20 GHz) 8 1024 459.00 KM128 10 31 2019 20191215-PC-045
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
