Write a C++ program that will ask the user for the name of a data file.
This data file contains a list of students in some class.
The names are listed, one per line, in the following format:
lastName firstName middleInitial
and each part of the name is separated by a space.
Each student in this class has a data file that contains an unknown number of test scores. The name of each student’s data file is formed by concatenating the students first and last name and adding ".dat", for example:
Student Name: Tuel Dennis D
Student Data File: DennisTuel.dat
Your program should open each student’s data file, read in the scores and calculate the student’s average.
In addition to calculating the average for each student you should report the average for the class, and the highest and lowest test score in the class.
Note: All averages should be rounded to the nearest hundredth.
cout << fixed << setprecision(2);
Example:Data File: Students.dat
Tuel Dennis DDrummond Ann MMaxwell Virginia L
DennisTuel.dat
85
88
92
86
AnnDrummond.dat
95
72
88
89
VirginiaMaxwell.dat
68
75
83
98
Sample Program Output:
Enter Name of Data File: Students.dat
Students Average
Dennis D Tuel 87.75
Ann M Drummond 86.00
Virginia L Maxwell 81.00
Class Average: 84.92
Max Score: 98.00
Min Score 68.00
This is my answer, but its not correct. How to fix it.
#include
#include
#include
#include
#include
using namespace std;
int main(){
string name[3];
int tmpScore, studentTotal, minScore, maxScore, countStudent, countClass;
ifstream studentDat;
ifstream namelist;
double classTotal;
minScore = 100;
maxScore = 0;
classTotal = 0.0;
countClass = 0;
cout << setw(20) << left << "students";
cout << setw(5) << left << "Data" << endl;
while(!namelist.eof()){
for(int i=0;i<3;i++){
namelist >> name[i];
}
studentDat.open((name[1]+name[0]+".dat").c_str());
studentTotal = countStudent = 0;
while(!studentDat.eof()){
studentDat >> tmpScore;
if(tmpScore>maxScore){
maxScore = tmpScore;
}
if(tmpScore>maxScore){
minScore = tmpScore;
}
studentTotal += tmpScore;
countStudent ++;
}
studentDat.close();
classTotal += (double)studentTotal / (double)countStudent;
countClass++;
cout< < < < cout< <<(double)studentTotal/(double)countStudent
< }
cout << setw(20)< cout << (double)classTotal/(double)countClass
< cout << setw(20) << left << "Max Score:";
cout << (double)maxScore << endl;
cout << setw(20) << left << "min Score:";
cout << (double)minScore << endl;
namelist.close();
return 0;
}

Answers

Answer 1

Answer:

Explanation:

Enter information,

Enter name: Bill

Enter roll number: 4

Enter marks: 55.6

Displaying Information,

Name: Bill

Roll: 4

Marks: 55.6

THIS IS AN EXAMPLE I HOPE THIS HELPS YOU!!


Related Questions

Write a script called checkLetter.sh Review Greeting.sh for an example. Use a read statement and ask user to "Enter A, B, or C: "

If user types A, echo "You entered A"
If user types B, echo " You entered B"
If user types C, echo " You entered C"
Use the case structure to test the user’s string.
If user types any letter from lower case ‘a through z’ or upper case ‘D through Z’, echo "You did not enter A, B, or C".

Answers

Answer:

The code is given as below: The input and output is as given for one case.

Explanation:

echo -e "Enter A, B or C : \c" #Printing the line on the screen

read -rN 1 test #read the character in the variable test

echo

case $test in #Setting up the case structure for variable test

[[:lower:]] ) #checking all lower case letters

echo You did not enter A, B or C;;

[D-Z] ) #checking upper case letters from D to Z

echo You did not enter A, B or C;;

A ) #Condition to check A

echo You entered A;;

B ) #Condition to check B

echo You entered B;;

C ) #Condition to check C

echo You entered C;;

esac #Exiting the case structure

Using the chores.csv file fat the very bottom; write an awk script to return the average number of minutes required to complete a chore. Your solution must handle an undefined number of chores. zero points will be given to solutions that use a static number in their calculation.
Format floating point numbers to 2 decimal places.
Example output;
Average: 28.12
chores.csv
Chore Name,Assigned to,estimate,done?
Laundry,Chelsey,45,N
Wash Windows,Sam,60,Y
Mop kitchen,Sam,20,N
Clean cookware,Chelsey,30,N
Unload dishwasher,Chelsey,10,N
Dust living room,Chelsey,20,N
Wash the dog,Sam,40,N

Answers

Answer: Provided in the explanation section

Explanation:

According to the question:

Using the chores.csv file fat the very bottom; write an awk script to return the average number of minutes required to complete a chore. Your solution must handle an undefined number of chores. zero points will be given to solutions that use a static number in their calculation.

Format floating point numbers to 2 decimal places.

Example output;

Average: 28.12

chores.csv

Chore Name,Assigned to,estimate,done?

Laundry,Chelsey,45,N

Wash Windows,Sam,60,Y

Mop kitchen,Sam,20,N

Clean cookware,Chelsey,30,N

Unload dishwasher,Chelsey,10,N

Dust living room,Chelsey,20,N

Wash the dog,Sam,40,N

ANSWER:

BEGIN{

FS=","

}

{

if(NR!=1)

sum += $3

}

END{

avg=sum/NR

printf("Average: %.2f ", avg)

}' ./chores.csv

cheers i hope this helped !!

For each of the following, write C++ statements that perform the specified task. Assume the unsigned integer array will be located at 1002500 in memory when the array is declared. An unsigned integer occupies four bytes. The data type of unsigned integer is unsigned. Use the constant integer variable size that is initialized to value 5 to represent the size of the array. The very first element of the array is the 0th element.

Answers

Answer:

The answer is given as below.

Explanation

As the complete question is not given, the complete question is found online and is attached here with.

a)

int values[SIZE] = {2,4,6,8,10};

b)

int *aPtr;

c)

for(i=0;i<SIZE;i++)

printf("%d", values[i]);

d)

aPtr=values;

aPtr=&values[0];

e)

for(i=0;i<SIZE;i++)

printf("%d", *(aPtr+i));

f)

for(i=0;i<SIZE;i++)

printf("%d", *(values+i));

g)

for(i=0;i<SIZE;i++)

printf("%d\n", aPtr[i]);

h)

array subscript notation: values[3]

pointer/offset notation: *(values +3)

pointer subscript notation: aPtr[3]

pointer/offset notation: *(aPtr + 3)

i)

1002512 is the address is referenced by aPtr + 3 and 8 is the value stored at that location.

j)

1002500 is the address referenced by aPtr -= 2 and 2 is stored at that location.

Which type of appliance can host several functions, such as antimalware, firewall, content filter, and proxy server

Answers

Answer:

Web Security Appliance (WSA)

Answer:

utm

Explanation:

UnifiedThreat Management (UTM): A security appliance and/or software tool

which contains a combination of any of the following: antivirus/antimalware, firewall,

proxy server, content filtering, spam filtering, intrusion detection system, intrusion

prevention system, and network access control. The more robust the tool, the

higher the number of features available.

Edit cell B15 to include a formula without a function that divides the total regional sales in Quarter 1 (cell B14) by the number of salespeople (cell G2). Don't change the reference to cell G2 that is already there.

Answers

Answer:

=B14/G2

Explanation:

In cell B15 we would type = to set the value of the cell to the sum of the equation.

Then we have to type in the equation. In this question it is cell B14 divided by cell G2 written like: B14/G2

Then we combine both the = and the equation =B14/G2

The item "=B14/G2" will be written when we edit cell B15 to include a formula without a function that divides the total regional sales in Quarter 1 (cell B14) by the number of salespeople (cell G2).

What are the steps?

In cell B15, we need to type = to set the value of the cell to the sum of the equation.

Next step is type in the equation. In this question, it is cell B14 divided by cell G2 (B14/G2)

Hence, we will combine both the = and the equation =B14/G2.

Read more about cell function

brainly.com/question/13880600

#SPJ2

Other Questions
Will Mark Branliest What is the approximate mean absolute value for the data shown in the dot plot? 1.09 0.92 2 6 Find the area of a regular octagon with a side length of 12cm. Why is water necessary for life Which statements best characterize Communist beliefs? A volume of 38.7 mL of H2O is initially at 28.0 oC. A chilled glass marble weighing 4.00 g with a heat capacity of 3.52 J/oC is placed in the water. If the final temperature of the system is 26.1 oC , what was the initial temperature of the marble? Water has a density of 1.00 g/mL and a specific heat of 4.18 J/goC. Enter your answer numerically, to three significant figures and in terms of oC. Adriana works as a purchasing manager at a trading firm and earns a salary of 60,000 she has deductions of 3000 and tax credit of a 5000 and she pays an annual tax of 6000 what is your annual disposable income 57,000 46,000 55,000 52,000 hi can anybody help me with this i will mark them as brainliest Select the subject of the sentence. Butterflies often land on River Butterfly's nose. The woman was standing on a cliff 30 meters above where she landed. There was a safety fence 4 meters from the cliff edge that would have prevented her from taking a long distance to run and leap off the cliff. She landed 12 meters away from the base of the cliff. Her launch speed was calculated to be 4.86 m/s, meaning that to travel those 12 meters, she had to be traveling at 10.87 miles per hour (or moving faster than a runner at a 5.5 minute mile pace) as she left the cliff. Put all this information together. Why did forensic scientists determine that the womans body was thrown instead of concluding that she jumped off the cliff? Estoy cansada de ver cmo estamos destruyendo nuestro medio ambiente y creando 1. (recipiente / polucin). Nuestro bello planeta cada da ms 2. (depende / preserva) de nosotros y necesita que nosotros lo 3. (agotemos / protejamos). Tenemos fbricas en la ciudad que no 4. (intentan / derriten) de producir productos alternativos, menos peligrosos. Todava 5. (echan / limitan) sus desperdicios en nuestros ros y mares, siendo peligrosos para el medio ambiente. Lamentablemente, no todos en mi comunidad reciclan y no 6. (separan / dependen) la basura como deben hacerlo. Estoy segura de que estas acciones estn 7. (agotando / produciendo) el planeta Tierra. Hay que 8. (limitar / promover) acciones que ayudan al medio ambiente. Debemos educar al pueblo. Hay que 9. (intentar / depender) de ensear y comunicar las ideas de reciclar y conservar. La 10. (proteccin / polucin) del bienestar de nuestro planeta depende de nosotros. Salvemos nuestro planeta! Atentamente,Jenny the sum of 3x^2 + x - 7 and x^2 + 10 can expressed as The journal entry to record the use of utilities in a factory could include which two of the following: (You may select more than one answer. Single click the box with the question mark to produce a check mark for a correct answer and double click the box with the question mark to empty the box for a wrong answer. Any boxes left with a question mark will be automatically graded as incorrect.) A. Debit to Factory Overhead unanswered B. Credit to Factory Overhead unanswered C. Debit to Factory Utilities Payable unanswered D. Credit to Factory Utilities Payable unanswered E. Credit to Raw Materials unanswered F. Credit to Factory Wages Payable unanswered Two jokers are added to a 52 card deck and the entire stack of 54 cards is shuffled randomly. What is the expected number of cards that will be strictly between the two jokers? Classification of organisms into three domains is based on:A) the presence of a cell wallB) the number of cells in the organismC) cellular organizationD) nutritional requirements please help, i need to pass. which function represents the inverse of function f below? Which system of inequalities is shown? Multiply the polynomials I WILL GIVE BRANILEST! PLEASE HELPPPPPP a round flower garden with a radius of 23 metres is surrounded by a pathway of 2 metres wide. Calculate the circumference and area of the outer pathway. Sarah performs an experiment to determine the effect of nitrogen on plants. She studies the effect of nitrogen on the growth of the root hair, height of the plants, and nodule formation. Which factor is an independent variable? What is the slope of the line in the graph?