Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

With this assignment you will start to learn how to write a practical menu driven program that manages a list of data. You will use

With this assignment you will start to learn how to write a practical menu driven program that manages a list of data. You will use ? You should use a #define to set the upper bound of the list to 50 entries. ? Your code should be well designed, well commented and written with good style. Other Important Hints and Reminders: ? Start work on this as soon as possible. ? It is your responsibility to request this help in the form of specific questions. ? When you ask a question, it should be specific, and you should provide the current version of your code. ? The current version of your code should be neatly formatted and commented. It should also be properly indented with meaningful variable and function names. This will make it easier for anyone helping you to understand what you are trying to do. ? Your character arrays DO NOT need to process white space, you can use scanf with %s with the space before %. o For example, assume the name of your array is list and you want to scan in the artist: scanf( %s, list[loc].artist); If you try to enter an artist with white spaces (Better Than Ezra), the program will not work properly, it is better to use (BetterThanEzra) or (Better.Than.Ezra) with no white space between the words. ? Your assignments will be graded with input that does not have any white space between the words, if you want assistance to have input with space between the words please contact your instructor. NOTE: there will be no guarantee of assistance with this assignment on the last few days before it's due so DO NOT leave this assignment to the last minute. 2. //hardcodes five entries 3. //runs the menu and gets the user choice 4. //prints the contents of the list onto the screen 6. //adds an item to the list 7. //displays the ids in the list, gets the id from the user and returns it Function descriptions: 1. //Greets the user 5. //prints a report to a file /*declare the file pointer, connect to the file and close the file pointer all inside this function*/ 8. //searches the list by id and returns the index, if there is a match or returns -1 //three arguments: list, number of items, id 9. //removes an item from the list //takes three arguments, the list, the number of items and the location //see the exe file example, the list DOES NOT need to stay in order 10.//updates an item in the list //takes three arguments, the list, the number of items and the locationan array of structs to organize the data and you will save the information in a text file. The focus (topic) of your program is up to you. The Menu commands must include: P....Print the inventory list onto the screen A....Add a new entry C....Clear all records

S....Create a current report (save it to a file) D....Delete an item from the list (inventory) U....Update ONE OF THE FIELDS (not THE id) Q....Quit ? You will use structs and an array to organize the data in the program. Your struct must contain at least the following kinds of information: o Minimum of 2 strings (character arrays) ? Suggestions include: item name, manufacturer, etc o Minimum of 2 integers 1 must be product id ? Suggestions include: Product id, qty in stock o Minimum of 2 double values ? Suggestions include: cost, price, average inventory ? When you add new item the program will ask the user for each of the fields on a separate line. ? When you delete an item from inventory the program will ask you for the integer id of the entry to be deleted, locate the entry in the array and remove all of the data for that entry. The list does not need to be sorted to remove an entry, you may move the last item in the list to the location of the deleted entry ? When you display the records on the screen, all of the information stored for each entry will be labeled and displayed. ? Creating a current inventory report copies the current entries in the array to an output file. This must include labeling all of the information so that it is clear what information is being provided. Instructions: ? You should use at least the 10 user-defined functions described below (plus main) to appropriately break the problem up into smaller pieces. ? Your program must start up with at least 5 valid records. These records must be hard coded into your program. (This must be done in one of your user-defined functions) ? You should use function prototypes and NO global variables (penalty)

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 Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

Evaluate the integral. Does Cauchys theorem apply? Show details.

Answered: 1 week ago