Tuesday
September 30, 2014

Homework Help: Computer Science

Posted by Keisha on Saturday, July 3, 2010 at 11:57am.

Can anyone please write a basic c++ code for the following instructions?
Congratulations! You’ve been hired by the Fly-By-Night-Engineering-Company, Your new supervisor asks you to write a C++ program that will manage a list of robotic sensors, stored in an array of structs. This program will give you practice inputting data from files, writing and calling functions, using arrays and outputting data to a file. You should only use one array of structs.
The infotype in this problem will consist of a robotic sensor name (string), an ID number (string), an energy level (int), and a counter(int). New entries are added to the end of the array. Whenever an item is accessed by the FIND or MODIFY command, its counter is incremented by one.
Prompt the user to input the name of the data file. (5 pts) The input contains lines of the following format:
<command> < data for processing the command>
commands are: INSERT, MODIFY, REMOVE, FIND, PRINT, EXIT
//----------------------------------------------------------------------------------------------------------------
INSERT will be followed by a name, ID number, and energy level.
(10 pts) Insert a new entry with the name, ID number, energy level, and zero counter to the end of the array
//----------------------------------------------------------------------------------------------------------------
MODIFY will be followed by a robotic sensor name and a new ID number
( 10 pts) Changes the ID number for the indicated name. Increment the counter.
//----------------------------------------------------------------------------------------------------------------
REMOVE will be followed by the name of the robotic sensor to delete from the array
(10 pts) removes the entry with the indicated name from the array
//----------------------------------------------------------------------------------------------------------------
FIND will be followed by the ID number to find in the list
(10 pts) print out the indicated name for the specified ID number. Increment the counter.
//----------------------------------------------------------------------------------------------------------------
PRINT (print) will have no additional data
(5 pts) Print the contents of the array; print name, ID number, energy level, and counter for each entry
//----------------------------------------------------------------------------------------------------------------
EXIT (exit) will have no additional data.
(10 pts) stop processing; do the following prints to the screen:
Use Selection sort to sort the array in order by name.
Print the entire list.
Print the list entries with a zero counter. (these were not Found or Modified)
Print the list entry with the largest counter. (this was the most accessed/altered user data)
In addition print the entire list to an output file.
Name the output file with your first and last name.
Notes:
1. Print a message if the name being searched for is not in the array.
2. Do not use global variables; pass parameters.
3. You should use functions to accomplish each task. You must have at least five functions.
4. Make sure that your output has a heading and is labeled.

Tips
You cannot just read the file and put each line into the array. You need to read the command on the line and then decide what needs to happen.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Business Management - You have recently been hired as a new manager hired into a...
Group process? - This old supervisor works at shop soon another supervisor gets ...
Scenario Question? - Dan is an employee at a regional mid-size computer company ...
Math - I need help please A computer can execute 64 instructions per second. How...
PROGRAMMING - PLS, I NEED TO BE GUIDED ON HOW TO WRITE A SIMPLE PROGRAM IN BASIC...
Computer Science - I need help with this question please! Please write me step ...
business - You have recently been hired as a new manager hired into a failing ...
Accounting - Write a 200- to 300-word response to the following: You have been ...
Programming - Here is the question that I need help to write the code for the ...
math - R. C. Droid has developed a new computer. He calls it the Droid computer...

Search
Members