subject
Computers and Technology, 16.12.2019 19:31 bbyarxi

You will be given a file that will contain averages for classes which are divided into sections in the following format. the name of this file will be "grades. txt".

a 93
b 82
a 86
c 75
f 83
you are to write a program that computes the averages for the sections of classes, they are divided into groups that are denoted by a capital letter. you are to use arrays to calculate the average. i recommend using two arrays one to keep a sum of the averages and the other a counter for how many classes have been added to the sum.

the equation for calculating the average is:

(sum of numbers in list) / (number of numbers in list)
given this you can have one array to keep a sum of the numbers that you are given and the other to keep a count of the number of classes in that section. the section names will be from a - z and will always be capital letters. the averages will be from 0 - 100 inclusively.

your program should output to the console the highest average section, lowest average section, and the average score across all of the sections. output both the section name and the score for that section. to a file you will print the average for each section in alphabetical order. always output the scores with two decimal places.

to the console:

highest average: : 98.00
lowest average: : 73.00
average score: .00
to a file named "results. txt":

a: 98.00
b: 93.00
c: 85.21
d: 95.12
.
.
.
z: 78.25
in c++

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, jairus34
We as humans write math expression in infix notation, e. g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i. e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix. write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
image
Computers and Technology, 23.06.2019 00:10, makailaaa2
My has been slow anyone else’s ?
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, genyjoannerubiera
This graph compares the cost of room and board at educational institutions in texas.
Answers: 1
image
Computers and Technology, 25.06.2019 03:00, reearamrup27
Match the categories in the first column with examples in the second column. 1. good for watching movies 2. maximum power with small size 3. older style mobile devices that may or may not have internet connectivity tablet computer a.)pda b.)smart phone c.)tablet computer
Answers: 1
You know the right answer?
You will be given a file that will contain averages for classes which are divided into sections in t...

Questions in other subjects: