Computer Science

posted by .

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.

  • Computer Science -

    No, I definitely can NOT! But here are some links to tutorials which may help:

    http://search.yahoo.com/search?fr=mcafee&p=how+to+write+a+basic+c%2B%2B+code+tutorial

    Sra

  • Computer Science -

    This is definitely not a "basic" C++ program, since you will need to use struct, functions, string manipulations and input/output.

    I find it curious that C++ is based on objects and classes, while C requires the use of structs to organize data. Why would one use structs in C++?

    If you would start the project with pseudocodes, or actual coding, and post the difficulties you encounter, someone would be glad to help you overcome them.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. PROGRAMMING

    PLS, I NEED TO BE GUIDED ON HOW TO WRITE A SIMPLE PROGRAM IN BASIC THAT WOULD PROMPT 3 LEVELS OF AUTHENTICATION WHEN UNAUTHORISED LOG-ON IS EFFECTED. You are not going to be able here to get detailed help on the program code, as there …
  2. business

    You have recently been hired as a new manager hired into a failing division in a company. The product line is outdated and losing market share, inter-departmental communication is adversarial, and competition for corporate funding …
  3. Business Management

    You have recently been hired as a new manager hired into a failing division in a company. The product line is outdated and losing market share, inter-departmental communication is adversarial, and competition for corporate funding …
  4. Programming

    I need your help to write a program using visual basic 2010 for the following:- write a program that calculates the average of up to 50 numbers input by the user and stored in an arrey. The program should use a class named Statistics …
  5. Programming

    Here is the question that I need help to write the code for the following program in Visual Basic 2010. I am trying to write the code but it has a run time error. If your could helps me to write the code it would be greatly appreciated. …
  6. COMPUTER SCIENCE

    Which of the following is a type of software program used to write code and develop other programs. A: a command line interpreter B: the turtle graphics window C: an operating system D: an integrated development environment Please …
  7. computer science

    Which of the following is a type of software program used to write code and develop other programs. A: a command line interpreter B: the turtle graphics window C: an operating system D: an integrated development environment Please …
  8. basic programming principles

    2.Write only the select case statements for the following problem statement. The marital code of a person is stored in the variable called marCode. Display the corresponding description on the screen. Provide for an incorrect marital …
  9. science

    Write a java program using classes and object to read the em[loyee code (Integer), Imployee name (string), Basic salary )double), Category (Character)then calculate the bonus(double)and the total salary(double)eligible for each employ. …
  10. computer,science, java

    Inorder to motivate the employees, the company has decided to announce the different types of bonus depends up on the employee’s Grade. If the employee belong to Grade A bonus=20% basic Grade B bonus=15% basic Grade C bonus=10% basic …

More Similar Questions