Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO IT WITH ----------C LANGUAGE----------there is also one example. Tianguage 1 Write a program designed for a vintage clothing shop. The data about the

PLEASE DO IT WITH ----------C LANGUAGE----------there is also one example.

image text in transcribedimage text in transcribed

Tianguage 1 Write a program designed for a vintage clothing shop. The data about the items is stored in "items.txt" file. Each line of the file includes item ID, item type, decade of the item's production, color of the item and price of the item. Each of these parameters are separated by */ character. Read the data of each item into an array of item structures. Define an item structure to store itemID, itemType, decade, color, price. Your program will display the following menu continuously until user chooses 10 to exit. 0. Read data from file 1. List all the items 2. Show item information 3. Insert new item 4. Remove an item 5. Update an item 6. Sort items based on decade 7. Sort items based on price 8. Find and display all the items of a specific type 9. Write the last 3 items that were added into "newcomer.txt" 10. Exit Choose the task (0-10): Use functions below: (You may use more functions but not less!) a. readFile(): receives name of the file as a parameter and inputs data into an array of structures and returns the array to the calling function. b. listItems(): receives array of structures and properly prints out all of the item information line by line c. showItem(): receives an array of structures as a parameter and inputs ID of the item from the user. Outputs item information. d. insertItem(): receives array of structures, inputs item data from the user and adds it to the end of the array if that item ID does not exist in the array, otherwise it gives an error message. e removeltem(): receives an array of structures, inputs item ID from user and removes that item from the array and returns the updated array and its size and gives an appropriate message to the user upon task completion. f. updateItem() receives an array of structures, inputs item ID from user and inputs item data for each of the parameters and updates the item accordingly and returns the updated array and gives an appropriate message to the user upon task completion. g. sortDecade(): receives an array of structures and returns the sorted version of this array based on the decades of item productions, and gives an appropriate message to the user upon task completion h. sortPrice(): receives an array of structures and sorts and returns this array based on the prices of items, and gives an appropriate message to the user upon task completion. i. listType(): receives an array of structures and inputs a type of clothing from the user. Prints out a list of all the items that belong to this category, if there is none give an error message. j. newcomers(): receives an array of structures and writes the last 3 items that were added into the array (last 3 elements of the array) to "newcomer.txt". 19/earrings/20/gold/25.00 25/skirt/60/pink/34.99 13/pants/80/brown/52.50 32/shoes/70/green/40.00 24/shirt/90/black/32.79 68/tshirt/50/white/9.99 47/shoes/80/teal/35.70

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

Students also viewed these Databases questions

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago

Question

1. The evaluation results can be used to change the program.

Answered: 1 week ago