Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 8, Program Design USF is creating an online store to sell t-shirts from its student organizations. They are hiring someone to code the backend

image text in transcribed
Project 8, Program Design USF is creating an online store to sell t-shirts from its student organizations. They are hiring someone to code the backend of the system. which will be used by a staff to enter the information about the available t-shirt into the store database. You really want to get this position, so you decided to show off your skills by implementing a prototype in C using dmamicallg allocated linked lists. Each t-shirt model will have the following information stored in the database: - student organization name: string with spaces and at most 50 characters - size: strings of at most 3 characters (e.g.. "XS". "S". "M". "L". "XL\". "XXL"] - price: real number with at most two digits after the decimal point - quantity in inventory: non-negative integer number smaller than or equal to 1000 You already have a sketch for the code in the file tshir't_store.c. now you must complete the following functions: 1. add_to_inventory: a. Ask the user to enter the student organization name and the size. b. Check if the inventory has a t-shirt for this organization with this specific size. If yes. your program should print a message stating that this t-shirt already exists and exit the function. Otherwise, ask the user to enter the price and the quantity. allocate memory for a new t-shirt and save the entered information. add it to the end ofthe linked list, and then exit the function. 6. When exiting this function. return a pointer to the first element. of the linked list. 2. search_by_organizatiorl: search by a student organization name. Ask the user to enter the name of the organization. Find all t-shirts on inventory for this organization. Display organization name, size. price and quantity. If no t-shirt is found. print a message. 3. search_by_size: search by t- shirt size. Ask the user to enter the desired size. Find all t-shirts on inventory with this size. Display organization name, size. price and quantity. Ifno t-shirt is found. print a message. 4. search_by_pr1ce: search by t-shirt prioe. Ask the user to enterthe maximum price. Find all t-shirts on inventory with price smaller than or equal to the maximum price. Display organization name. size. price and quantity. If no t-shirt is found. print a message. 5. print_1nventory: print organization name. size, price and quantity for all t-shirts on inventory. 6. c193r_:lnventory: when the user exits the program, deallocate all the memory used for the linked list. Note: use the read_11rle function to read the name of the student organization. Testing guidelines: 1 . Download the les try_rshirt_srore and rshirLst'orec from Canvas and upload them to the student cluster (scr'cuafatdu). Change the file permissions of the test script with the following command: chmod +x try _rshirt_store . Complete the missing functions of tshr'rLstorex: . Compile and test your solution for Project 8: get: -Wa.ii -std=c99 tshirt_srore .r: on Jrry_tsh t'r.t_srore

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

4. In what stage of the product life cycle is The Body Shop?

Answered: 1 week ago