Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COP 2220 Into programming in C(Answer in C, not C++). The question is: Please write the algorithm for a programming assignment. The details of the

COP 2220 Into programming in C(Answer in C, not C++). The question is:

Please write the algorithm for a programming assignment. The details of the assignment, a sample algorithm, and its outline, are located below. Make the algorithm at least half a page, easy to read, and to understand, how it works. I just want the algorithm, not the programming code, I have that. I only need the ALGORITHM. Thanks for helping me out, I appreciate it, have a pleasant day. If you also provide the code, it would be very appreciated.

SAMPLE ALGORITHM:

(FOR A DIFFERENT PROGRAMMING ASSIGNMENT):

1. Display instructions 2. Ask user for number of games to play 3. For each game a. get a letter from file b. Play one game i. While still has guesses ii. Get guess from player iii. Compare guess to letter from file iv. If guess is correct, return 1 v. Else increase counter vi. Return 0 if 5 guesses incorrect c. check for win or lose

ASSIGNMENT REQUIREMENTS/OUTLINE:

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 an array of structs to organize the data and you will save the information in a text file. Choose one of the following program types: The assignment is to write a menu driven program that manages a small business inventory, collection or list. You pick the topic!!! The focus of your program is up to you.

The Menu commands must include:

P....Display all records (on the screen/monitor)

S....Create a current report (save it to a file)

A....Add a new entry

D....Delete an item from the list (inventory)

C....Clear all records

Q...Quit

You must add (1) additional menu option that you choose. It may be a menu option that allows the inventory to be modified. i.e. add inventory quantities, change price/cost, change dates, etc.

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

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.

Clearing the records deletes all of the information in the array.

When you add new item the program will ask the user for each of the fields on a separate line.

Creating a current report copies the current content of the question 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 10 user-defined functions (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 in your program file. (This can be done in one of your user-defined functions)

You need to begin the program with general instructions on your program, an outline of the data fields and the format needed to enter the data You should use function prototypes and NO global variables.

You should use a #define to set the upper bound of the list to at least 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.

You are expected to receive as much help as you need for the basic assignment.

It is your responsibility to request this help in the form of specific questions.

You may ask these questions during office hours or by sending them via email to me and the TA.

When you ask a question, it should be specific, and you should provide the current version of your program.

The current version of your program should be neatly formatted and commented. It should also be properly indented and use meaningful variable and function names. This will make it easier for anyone helping you to understand what you are trying to do.

SAMPLE OUTPUT:

Hello and welcome.

This program helps you create an inventory for skate shoes.

To get you started, 5 shoes have already been entered.

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT What would you like to do:

p

----Catalog Entry 1----

BRAND:

Globe

NAME:

Sabaton

I.D.#: 101

QTY: 45

COST: $30.00

PRICE: $65.99

----Catalog Entry 2----

BRAND:

Vans

NAME:

Authentic

I.D.#: 102

QTY: 3

COST: $30.00

PRICE: $65.99

----Catalog Entry 3----

BRAND:

Globe

NAME:

Ease

I.D.#: 103

QTY: 14

COST: $20.00

PRICE: $35.99

----Catalog Entry 4----

BRAND:

Vans

NAME:

Classic

I.D.#: 104

QTY: 61

COST: $10.00

PRICE: $15.99

----Catalog Entry 5----

BRAND:

Globe

NAME:

Focus

I.D.#: 105

QTY: 6

COST: $40.00

PRICE: $85.99

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT What would you like to do:

u

Enter the I.D.# of the entry you would like to update: 104

----Catalog Entry ----

BRAND:

Vans

NAME:

Classic

I.D.#: 104

QTY: 61

COST: $10.00

PRICE: $15.99

Please enter the new price: 9.99

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT

What would you like to do: p

----Catalog Entry 1----

NAME:

Sabaton

I.D.#: 101

QTY: 45

COST: $30.00

PRICE: $65.99

----Catalog Entry 2----

NAME:

Nomad

I.D.#: 102

QTY: 3

COST: $30.00

PRICE: $65.99

----Catalog Entry 3----

NAME:

Ease

I.D.#: 103

QTY: 14

COST: $20.00

PRICE: $35.99

---- Catalog Entry 4----

BRAND:

Vans

NAME:

Classic

I.D.#: 104

QTY: 61

COST: $10.00

PRICE: $9.99

----Catalog Entry 5----

NAME:

Focus

I.D.#: 105

QTY: 6

COST: $40.00

PRICE: $85.99

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT

What would you like to do: c

Your catalog has been cleared of all entries.

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT

What would you like to do: p

***** Catalog is empty *****

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P- PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT

What would you like to do: a

Please enter the Brand of the shoe: Globe

Please enter the name of the shoe: Encore

What is this shoe's I.D. number: 110

What is this shoe's quantity: 33

How much does this shoe cost: 10.00

How much will you charge for this shoe: 19.99

Your entry has been added to the catalog.

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT

What would you like to do: p

----Catalog Entry 1----

BRAND:

Globe

NAME:

Encore

I.D.#: 110

QTY: 33

COST: $10.00

PRICE: $19.99

******************************************

Please select from the options below:

A - ADD a new entry

D - DELETE an entry

P - PRINT entire catalog

S - SAVE the current catalog

C - CLEAR entire catalog

U Optional Item

Q - QUIT

What would you like to do:q

Goodbye. Press any key to continue . . .

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

5.4 Describe how culture can influence self-esteem.

Answered: 1 week ago