Calculate the average of the five grades passed in

Assignment Help Programming Languages
Reference no: EM131270258

Create a program that will display a menu to the user. The choices should be as follows:

1) Enter 5 student grades

2) Show student average (with the 5 grades)

3) Save grades (save the 5 grades only to the file)

4) Load grades (read 5 grades from a file)

5) Exit

Use a switch statement for the menu selection and have it pick the appropriate function for the menu choices. Each option should be implemented in its own function. Initialize the grades randomly between 0-100. So if the user select show student average as their first choice, there will be some random grades in the list already.

Function1 : Ask the user for 5 grades and place them into 5 variables that should be passed in as parameters, validate that the grades are in the range between 0-100 (use a loop).

Function2: Calculate the average of the 5 grades passed in and display the average with 1 decimal place and also display the letter grade.

Average

Letter Grade

90 - 100-A

80 - 89-B

70 - 79-C

60 - 69-D

Below 60-F

Function3: Write the 5 grades to a file called "myGrades.txt" Make sure to include an if statement in case the file is not able to be opened and give an appropriate error message.

Function4: Read 5 grades from a file called "myGrades.txt". Make sure to include an if statement in case the file does not exist and give an appropriate error message.

Use a loop to repeat the entire program until the user hits 5 to exit.

Reference no: EM131270258

Questions Cloud

Design a program that will gather a group of floating point : Design and implement a Java program that will gather a group of floating point numbers and determine the sum and average of the data entered.
Describe key elements of the role that congress plays : Describe key elements of the role that Congress plays within the U.S. federal system, with particular focus on Congress' ability to reflect the will of the people. Support your argument with at least two concrete examples.
Domestic and international markets : How does international trade affect the prices in the domestic market and decisions related to firms to compete in both domestic and international markets?
Environmental protection laws : We live in a country where environmental protection laws provide often questionable "protection" for US citizens. While you must evaluate whether you believe the following sources are accurate or not, here is a sampling current issues that affect you..
Calculate the average of the five grades passed in : Calculate the average of the 5 grades passed in and display the average with 1 decimal place and also display the letter grade.
Major investment in specialized equipment : You are in charge of procuring a machine for your factory. The process will take about a year to complete and is a major investment in specialized equipment that will make or break the profitability of the company. It is expected the equipment will o..
How can sale manager reinforce ethical behavior : what traits and behaviours would an ethical salesperson possess and how might this help the sales person close deals? how can a sale manager reinforce ethical behavior.
Define psychology and psychological adjustment : Identify contextual variables (e.g., culture) that impact psychological adjustment. Describe self-concept, self-esteem, and identity. Define stress, stressors, and coping strategies, and contemplate their relationship to health and wellness.
Create a program that keeps track of specific information : Create a program that keeps track of specific information for Students. The information stored should be the following: First Name, Last Name, Major, GPA, UIN, NetID, Age and Gender.

Reviews

Write a Review

Programming Languages Questions & Answers

  Use one-dimensional array to solve problem

Use one-dimensional array to solve following problem. Read in 10 numbers, each of which is between 10 and 100 inclusive.

  Different ways to pass values to methods

There are 2 different ways to pass values to methods. List these 2 methods and discuss how they can be used. Included the pros and cons of each type

  Create the logic for a program which merges two files

Create the logic for a program which merges the two files into one file containing list of all students in district, maintaining student id number order.

  Write program to reads student-s name with test scores

Write down a program which reads student's name together with his or her test scores. Program must calculate the average test score for each student and allot the suitable grade.

  Explain programming is designed to demonstrate the areas

This programming lab is designed to demonstrate the following areas of knowledge within C++, The difficult part is intended to be the decision-making required to both parse the file input and to correctly draw the resulting vector.

  Write program to compute diameter in centimeters

Write a program to compute the diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Perform the unknown mathematical operation

Loop the program using a WHILE LOOP to get the next equation to be tested and repeat the process - Write a program to test for the case of a math equation entered via the keyboard using the SWITCH-CASE operator.

  Create an employee object using the default constructor.

Create an Employee object using the default constructor. Prompt for and then set the first name, last name, gender, dependents, and annual salary. Remember that you have to convert gender, dependents, and annual salary from strings to the appropri..

  Write program which simulates checkout queue object

Write program which simulates checkout line at supermarket. Line is queue object. Customers (i.e., customer objects) arrive in random integer intervals of 1-4 minutes.

  Create two objects p and q and generate 10 random numbers

Create Two objects P and Q. in object P the array a is type int and size 10, in Q array a is string type and size 12b. Generate 10 random numbers

  Write function which take parameter-string and returns vowel

Write function which takes as parameter and string and returns the vowels (a, e, i, o, u). Function prototype should look like: void countVowels(string str, int& aCt, int& eCt, int& iCt, int& oCt, int& uCt);

  Program to multiply two integers

What occurs when you multiply two integers whose product is larger than largest int value? Try out example and report your findings.

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