I need to write a program in c++
Suppose a teacher weights four exams. He gives 10%, 25%, 30%, and 35%.
Write a program that reads ten sets of four grades, prints the weighted average of each set, and prints the unweighted average of each test. The number of students should be in a global constant.
Please help. Thank you
#include <iostream>
#include <string>
using namespace std;
int NUM = 2;
int main()
{
int student[NUM][4];
cout<<"Enter marks for: "<<NUM <<" students
"<<endl;
for(int i=0;i<NUM;++i){
for(int j=0;j<4;++j){
cin>>student[i][j];
if(j==0){
student[i][j] = student[i][j]*0.1;
}else if(j==1){
student[i][j] = student[i][j]*0.25;
}else if(j==2){
student[i][j] = student[i][j]*0.3;
}else{
student[i][j] = student[i][j]*0.35;
}
}
}
double average = 0;
for(int i=0;i<NUM;++i){
average = 0;
for(int j=0;j<4;++j){
average = average +
student[i][j];
}
cout<<"\nWeighted average of student
"<<(i+1)<<": "<<average/4;
}
}
===========================
See Output
![1 #include <iostream> 2 3 using namespace std; 4 int NUM -2; 5 int mainO #include <string» 7 int student [NUM] [4]; cout<< E](http://img.homeworklib.com/questions/faa310f0-80ce-11eb-8cdc-671f3509d9df.png?x-oss-process=image/resize,w_560)
Thanks, let me know if there is any concern.
I need to write a program in c++ Suppose a teacher weights four exams. He gives...
C++ Write a program that reads the number of students in the class, then reads each student's name and his/her test score. Print out each student name, test score and grade, and the average score of the whole class. The program must use vectors and loops for the implementation. The grades are determined as follows: A >= 90; 80 <= B < 90; 70 <= C < 80; 60 <= D < 70; F < 60.
This is a C++ Program, I need the program broken up into
Student.h, Student.cpp, GradeBook.h, GradeBook.cpp, and
Main.cpp
1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assignment groups: homework (total of 5), quizzes (total (total of 2) of 4), and exams 2. For each student record, the user should be able to change the grade for any assignment These grades should be accessible to the gradebook for...
Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...
You must assume that the data file and your four function
subprograms are located inside the working directory (forder).
Please write the main program and each of the four function
subprograms.
1. The data in the following table are to be read from the file "grades.txt"and processed The grades are in percentages. The format of the data is shown below First Name ID Number Last Name Grades 001AA Tam 78.50 oe 86.45 001AB Gabriel Stuart Thus, there are 4 columns...
Language: C++ Write a program that will allow the instructor to enter the student's names, student ID, and their scores on the various exams and projects. A class has a number of students during a semester. Those students take 4 quizzes, one midterm, and one final project. All quizzes weights add up to 40% of the overall grade. The midterm exam is 25% while the final project 35%. The program will issue a report. The report will show individual grades...
Consider the following program that reads students’ test scores into an array and prints the contents of the array. You will add more functions to the program. The instructions are given below. For each of the following exercises, write a function and make the appropriate function call in main.Comments are to be added in the program. 1. Write a void function to find the average test score for each student and store in an array studentAvgs. void AverageScores( const int scores[][MAX_TESTS], int...
Plz help!! The programming
language is C and could you write comments as well?
Problem 2. Calculate Grades (35 points) Arrays can be used for any data type, such as int and char. But they can also be used for complex data types like structs. Structs can be simple, containing simple data types, but they can also contain more complex data types, such as another struct. So you could have a struct inside of a struct. This problem deals with...
Please help. I need a very simple code. For a CS 1 class. Write a program in Java and run it in BlueJ according to the following specifications: The program reads a text file with student records (first name, last name and grade). Then it prompts the user to enter a command, executes the command and loops. The commands are the following: "printall" - prints all student records (first name, last name, grade). "firstname name" - prints all students with...
c++ A menu-driven program gives the user the option to find statistics about different baseball players. The program reads from a file and stores the data for ten baseball players, including player’s team, name of player, number of homeruns, batting average, and runs batted in. (You can make up your data, or get it online, for example: http://espn.go.com/mlb/statistics ) Write a program that declares a struct to store the data for a player. Declare an array of 10 components to...
using C geany. Please Dr. exercise # 1 and 2
During the lab: PART I: PROGRAMMING EXERCISES a. Using Geany, write a C program that prompts and asks the user for two assignment marks (al and a2) and two test marks (ti and t2). All four variables are integer variables and are in % (out of 100). You program should display the four marks properly lalebed to check if the input has been successful. b. Next, calculate and display the...