Write program to compute and outputs the average gpa

Assignment Help Programming Languages
Reference no: EM1360772

For research purposes and to better help students, the admissions office of Sharjah University wants to know how well female and male students perform in certain courses. You receive the file that contains female and male student GPAs for certain courses. Due to confidentiality, the letter code f is used for female students and m for male students. Every file entry consists of a letter code followed by a GPA. Each line has one entry. The number of entries in the file is unknown. Write a program that computes and outputs the average GPA for both female and male students. Format your results to two decimal places. Your program should use the following functions:

1. Function openFiles: This function opens the input and output files, and sets the output of the floating-point numbers to two decimal places in a fixed decimal format with a decimal point and trailing zeros.
2. Function initialize: This function initializes variables such as countFemale, countMale, sumFemaleGPA, and sumMaleGPA.
3. Function sumGrades: This function finds the sum of the female and male students GPAs.
4. Function averageGrade: This function finds the average GPA for female and male students.
5. Function printResults: This function outputs the relevant results.
6. There can be no global variables. Use the appropriate parameters to pass information in and out of functions.

Reference no: EM1360772

Questions Cloud

What will happen to that particle : At the instant of engine burnout, the rocket has risen to 52 m and acquired a velocity of 40 m/s. The rocket continues to rise in unpowered flight, reaches most height and falls back to the ground.
Compute point elasticities at prices : Compute point elasticities at prices of 5 and 9. Is the demand curve elastic or inelastic at these points.
Explain the propose two adjustments that you as : Explain the Propose two adjustments that you as a Human Resources manager can make to support the changes related to high-performance work systems
What is the optimal number of orders per year : Calculate the optimal interval in working days between orders TBO and what is the optimal number of orders per year
Write program to compute and outputs the average gpa : Write a program that computes and outputs the average GPA for both female and male students. Format your results to two decimal places. Your program should use the functions.
Assessment of ssps using quantitative reasoning and analysis : How does SSPS assess one's progress and skills using quantitative reasoning and analysis. To what extent can one use SPSS to inform one's understanding of research?
Illustrate what suggest about demand elasticity for drugs : Illustrate what does this suggest about demand elasticity for drugs. Could it be that this experiment didn't actually measure elasticity very well and that elasticity is quite large.
Estimate the value of stock : The Joe Corporation is experiencing financial difficulties. Its dividends and earnings are falling at a constant rate of 7 percent per year. Its stock just paid an yearly common stock dividend of $1.50 each share.
How much work is required to stretch the spring : How much work is required to stretch the spring. A satellite is in a low circular orbit about the Eart.

Reviews

Write a Review

Programming Languages Questions & Answers

  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.

  Deisgn class contains data fields for height and surfacearea

Deisgn a class named Rectangle that contains data fields for height width and surfaceArea and a method named computeSurfaceArea?

  Explaining law of diminishing returns

As computer word size gets larger and larger, there is a law of diminishing returns; speed of execution of application programs doesn't increase and may, in fact, decrease.

  Create program to calculate and display number of miles

Create a program to calculate and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the drivers speed.

  Write statement essential to call compute interest method

Write statement essential to call the calculate interest method with an account balance of $2300.00 and an interest rate of 5%. What rule must be adhered to when calling a method with multiple parameters?

  Create application which permits user to input a price

Create an application which allows a user to input a price until suiatble sentinel value is entered. Output is a price of each item on each day,one through seven.

  Program to fill 0s and 1s into tictactoe board

Write a program which randomly fills in 0s and 1s into TicTacToe board, prints board.

  Creating a software package for amazon

Suppose you are creating a software package for Amazon.com that needs users to enter their own passwords. Your software requires that users' passwords meet the following criteria:The password should be at least six characters long.

  Program to simulate rolling one die

Write a program which simulates rolling one die using the following steps: Prompt the user for the number of sides on the die.

  Write a program to print average grade of student

Write a program that read the grades.txt file and then prints the average grade of male and female students and the number of passed students by using the functions.

  Write a program using two-d array to store a user name

Write a program using a 2-D array to store a user name and password (both strings) that will ask the user for his/her user name and then test to see if they are a valid user.

  Create block using a loop to determine number of items

Create a block using a loop that will determine the number of items that can be purchased based on the price of the item and the total amount available to spend.

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