Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this first project, you will write a complete C + + program that will display a menu and, based on user input, perform a

In this first project, you will write a complete C++ program that will display a menu and, based on user input, perform a variety of operations a list of floating-point numbers.
Program Requirements:
As with all projects in this course, your programs output will display your name, your EUID, your e-mail address, the department name, and course number. This means that your program will print this information to the terminal (see Sample Output).
In a loop of your choice, you repeatedly display a menu of options until the user enters the selection to terminate the program as follows:
1. Display numbers in list
2. Add number to list
3. Remove number from list
4. Compute average of list of numbers
5. Compute minimum of list of numbers
6. Compute maximum of list of numbers
7. Exit program
Although you may assume that the user enters an integer in response to this menu, the integer may be out of range. If the user enters an invalid menu option (i.e., not an integer between 1 and 7, inclusively), your program will display an error message and re-display the menu.
If the user enters an integer between 1 and 7, inclusively, then your program will perform the requested operation as follows:
1. Display list of numbers
You will display all of the numbers in the current list.
2. Add number to list of numbers
You will prompt for and read in a floating-point number to add to the list, append the number to the list of numbers, and then display a status message indicating that the number was just added to the list of numbers.
3. Remove number from list of numbers
You will prompt for and read in a number to remove from the list, perform a sequential search for the number in the list:
If that number is found in the list of numbers, you will display a status message indicating that the number was removed from the list of
numbers and then perform the operation to remove that number from
the list of numbers.
If that number is not found in the list of numbers, you will remove the
last number in the current list and display a status message indicating that the number (i.e., the last number in the list) was removed from the list of numbers.
4. Compute average of list of numbers
You will compute the accurate average of the list of numbers and display the result.
5. Compute minimum of list of numbers
You will find the minimum value from the list of numbers and display the result.
6. Compute maximum of list of numbers
You will find the maximum value from the list of numbers and display the result.
7. Exit program
You will display a meaningful message that the program is terminating and exit the program.
After performing the above operations and printing the results, you will re-display the menu and accept new user input, thus repeating the process (except in the case of option 7 where the user wants to terminate the program).
You will perform needed error handling, such as attempting to perform an operation on an empty list by displaying an error message instead of actually performing the operation (see Sample Output).
You will use the appropriate data structure that supports being able to dynamically add or remove numbers from the list, thus changing its size.
Your program will also be graded based upon your program style. This means that you should use comments (as directed), meaningful variable names, and a consistent indentation style as recommended in the textbook and in class.
Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code.
Your program will be graded based largely on whether it works correctly on the CSE machines (e.g., cse01, cse02,..., cse06), so you should make sure that your program compiles and runs on a CSE machine. No regular or late credit will be given for any program that does not compile and run on the CSE Linux servers.
See the Sample Output for questions on the programs expected behavior. You should contact your instructor if there is any question about what is being asked for in this programming assignment.
This is an individual programming assignment that must be the sole work of the individual student. Any instance of academic dishonesty will result in a grade of F for the course, along with a report filed into the Academic Integrity Database.

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_2

Step: 3

blur-text-image_3

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 Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

Explain what is meant by the terms unitarism and pluralism.

Answered: 1 week ago