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

  Write program to ask user for low and high integer

Write a program that asks the user for the low and high integer in a range of integers. The program then asks the user for integers to be added up.

  Program to compute unit price of items sold

Manager of a Supermarket would like to be able to calculate the unit price of items sold there. To do this the program should input the name and the price of the item.

  Program to create professor rating class

Write down program to create Professor Rating class comprising of professor ID and three ratings. Three ratings are utilized to estimate easiness.

  Program that prompts user to enter five test scores

Write the algorithm for a program that prompts the user to enter five test scores.

  Deisgn child class that overrides parent method

Deisgn child class named Box, that contains additional data field named depth and a computeSurfaceArea() method that overrides the parent method appropriately for a three-dimensional box

  Find largest number in array

Find the largest number in the array and output the result. use a subprogram to input the numbers, a function to use the largest number.

  Write script to declare and sets variable equal to balance

Write a script that declares and sets a variable that's equal to the total outstanding balance due. If that balance is greater than $10,000.00, the script should return a result set consisting of VendorName.

  Write a program to create three identical list

Write a program to create three identical list, list1, list2, and list3, of 5000 elements. The program then sorts list1using quick sort, list 2 using insertion sort.

  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.

  Program to track which user is logged onto which computer

Write a computer program that could be used to track, by lab, which user is logged onto which computer.

  Use a two dimensional array to solve problem

Use a two dimensional array to solve the following problem. A company has four salespeople ( 1 to 4) who sell five different products ( 1 to 5).

  Probability line is executed in nth iteration of for loop

What is the probability that line is executed during the nth iteration of the for loop? What is the exact expected number of executions of line?

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