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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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