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

  Procedure to draw shape of choice

Write a program with a suitable procedure to draw shape of your choice. Your program must then call the procedure 10 times to draw the shape.

  Appropriate for two classes to inherit from superclass

CDs and DVDs have several common characteristics. Would it be appropriate for these two classes to inherit from a common superclass?

  Write a program that inputs number of hours worked

Write a program that inputs the number of hours worked and hoursly pay rat for employesand outputs their total pay.

  Designing navigation system for point-and-click system

Design a navigation system or menu allows Access to act like point-and-click system. Write down some of the kinds of navigation.

  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.

  Program to display weekly payroll report

Write down a program to display a weekly payroll report.

  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.

  Write program where dealer-s five-card hand is dealt

Write a program where the dealer's five-card hand is dealt "face down" so the player cannot see it. The program should then evaluate the dealer's hand.

  Write program to accept six pairs of values from user

Write a program that accepts six(6) pairs of values from the user and then calculates and stores the difference of each pair of values in an array.

  Program to accept candy name price per pound

A program that accepts a candy name (for example, "chocolate-covered blueberries"), price per pound, and number of pounds sold in the average month, and displays the item's data.

  Write a vhdl code for soda vending machine

Write a VHDL code that implements the above soda machine. You have to turn in the following: A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.

  Code to sum of all the elements of the array

Write some code that places the sum of all the elements of the array x into total. Declare any variables that you need.

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