Use structures and pointers to create linked lists

Assignment Help Data Structure & Algorithms
Reference no: EM131121680

Question: 

Objective: Use structures and pointers to create linked lists. Use knowledge of pointers to modify linked lists. Implement a recursive function.

Problem: FreePlay Arcade in Richardson has a primitive flat file database that needs to be updated. This database contains the names, high scores (w/ initials) and the total number of plays of their games. The database also contains the total amount each game would earn if not on free play. You will build a simple interface to interact with the database.

Details: The interface will provide the following options:

1. Add a record to the database

2. Search for a record and display it

3. Edit a record

4. Delete a record

5. Sort records

Add a record: Create a new node and add it to the database

Search for a record: The search term will be a word or phrase. Search through the entries and display the complete record for any game that matches the search term.

Edit a record: With a given game name, the program should update the record and confirm the change by displaying the new record on the screen. The following items can be edited:

1. High score

2. Initials

3. Number of plays

If number of plays is edited, the revenue should be recalculated

$0.25 per play

Delete a record: User will enter a game name. The program should delete the record from the file. The best way to do this is to delete the record from the linked list.

Sort records: The records can be sorted in ascending order (A -> Z or increasing numerically) by either name or number of plays.

Input will come from a batch file. Output will be written to a file.

The linked list will be written to the database file at the end of the program

No need to remove and rename when a delete is performed

All records are stored in memory with a linked list of structures

All manipulation to the database should happen within the linked list, not the output file

When deleting - if a record does not exist, write an error message to the log file

Expect that some test cases will involve there being no inventory.dat file at execution

Validate all input into the program

No need to validate name as it can be practically anything

Write error messages to the log file if invalid input is encountered and ignore the command

Be prepared for anything in terms of user input

Error messages written to the output file should be in ALL CAPS.

Database Format: The database file will be named freeplay.dat. Each record in the database will be on a single line with the following format. Each field will be separated by a comma and a space

<name>, <high_score>, <initials>, <plays>, <mce_markergt;<revenue><\n>

<name> - may be multiple words

<high_score>- 9 digits

<initials>- 3 characters- no white space

<plays>- 4 digits- will have leading zeroes if value less than 1000

<revenue>- <4 digits><decimal><2 digits> - will have leading zeroes if first four digits less than 1000

Input: All input will be file based. You will create a batch file to use with the database. The format for each option is listed below:

Add a record

1 "name" high_score initials plays $revenue<\n>

Search for a record

2 <search term>

2 Search term may contain spaces

Edit a record

   3 <name><field number><new value>

   <field number>

1 = high score

2 = initials

3 = number of plays

New value may not contain leading zeroes

Delete a record

4 <name>

Name may contain spaces

Sort records

   5 <name/plays>

A single word should follow the value: name or plays

Output: Each command in the input file will generate output to a file named freeplay.log. The output for each command is as follows:

Add a record

RECORD ADDED

Name: <name>

High Score: <high_score>

Initials: <initials>

Plays: <plays>

Revenue: mce_markerlt;value> - formatted to 2 decimal places

Search for a record

<name> FOUND or <name> NOT FOUND

If found

High Score: <high_score>

Initials: <initials>

Plays: <plays>

Revenue: mce_markerlt;value> - formatted to 2 decimal places

Edit a record

<name> UPDATED

UPDATE TO <field> - VALUE <value>

Name: <name>

High Score: <high_Score>

Initials: <initials>

Plays: <plays>

Revenue: mce_markerlt;value> - formatted to 2 decimal places

Delete a record

RECORD DELETED

Name: <name>

High Score: <high_Score>

Initials: <initials>

Plays: <plays>

Revenue: mce_markerlt;value> - formatted to 2 decimal places

Sort records

RECORDS SORTED BY <name/plays>

Reference no: EM131121680

Questions Cloud

What is the work done on the system in going from c to d : If the change in internal energy in going from point D to point A is +500 J, how much energy must be added to the system by heat as it goes from point C to point D?
Individuals interacting and interdependent : Two or more individuals interacting and interdependent, who come together to achive a particular objective are referred to as what?
Highlighting about the company management team : The article should highlight a company’s management team’s philosophy, style, values, etc.  What type of business? What is the article highlighting about the company’s management team? Is the company currently successful or unsuccessful with their cu..
Most common reason for managerial failure : A study of the top executives at fortune 500 companies discovered that the most common reason for managerial failure is what?
Use structures and pointers to create linked lists : Objective: Use structures and pointers to create linked lists. Use knowledge of pointers to modify linked lists. Implement a recursive function.
Why you do not prefer to comply with for their footsteps : The key reason why you do not prefer to comply with for their footsteps is normally up to you're keen on your family and friends; smooth against activities and might don't have this amount that you desire.
Generally the result of groupthink : What is generally the result of groupthink? ? Higher quality decisions ? More risky decisions ? Less critical analysis ? Unpopular decisions And, Please choose one Which of the following is true about virtual teams? ? There is an absence of verbal..
Evaluation process including fundamental fairness of system : According to Leonard (2008), it is important for employees to buy-in to the evaluation process including the fundamental fairness of the system. As a supervisor, what actions will you take to promote buy-in and acceptance of the evaluation process wi..
Write a program for playing a variation of the chinese game : Write a program for playing a variation of the Chinese game "Tsyan-shizi" called the game of NIM. Our version of the game starts with up to 20 rods and up to 10 stones in each rod. Two players take turns removing stones from the rods. On a player's t..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd