Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Algorithms and Data Structure 2 nd Practical Exam Computer Hardware Inventory Management In the following tasks you have to solve some problems in a computer

Algorithms and Data Structure 2nd Practical Exam
Computer Hardware Inventory Management
In the following tasks you have to solve some problems in a computer hardware inventory.
The input file is inventory.txt which contains the items and the datas about the items.
The first line contains the number of lines. Please read in it separetely.
From the second line each line in the file contains space-separated values in the format:
ItemName > Category > Quantity > Price_in_$ >
Example from the text file:
Intel_i7_9700K Processor 10320.0
AMD_Ryzen_9_3900X Processor 8410.0
Corsair_Vengeance_16GB Memory 5075.0
Task 1
Please read and store the text file in your C++ project into a structure type array.
Task 2: Total Quantity of a Category
Ask from the user (keyboard) a category and give the total quantity of items in that category.
Task 3: Total Value of Inventory
Calculate and print out the total value of all items in the hardware inventory.
Task 4: Find the Most Expensive Item
Find and print out the most expensive item in the hardware inventory.
Task 5: Count Items Above a Certain Price
Count and print out the number of items with a price greater than $300.
Task 6: Sort Items by Price
Sort the items in the inventory by price in ascending order and print out the sorted items.
Please make sure that your code is syntactically correct. If you submit it with syntactical errors your exam is fail.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

4. Identify the challenges facing todays organizations

Answered: 1 week ago