Write a class AdjustedAssignment that has private attributes for Name and a vector of integers Scores.
Add public set and get methods for Name
Write a public method addScore that accepts an integer and add it's to the score vector
write public methods for maximum, minimum and average - but before calculating, find the difference between the highest score and 100, and when calculating max, min and average, add that value to the result ( don't actually change the values in the vector in case a new highest score is added ).
For example, if I had the scores 70, 75, 80, 85, 90 - the average would be 80, the max would be 90 and the min would be 70, but the adjusted values would be 10 higher, because 100 - the max is 10. Adjusted average 90, adjusted max 100, adjusted min 80
Write a method that returns a Boolean value for if the average is at least 75
Please find the code below::
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class AdjustedAssignment {
private:
string name;
vector<int> scores;
public:
void setName(string n){
name = n;
}
string getName(){
return name;
}
void addScore(int n){
scores.push_back(n);
}
int getMaximum(){
int max = -9999;
for(unsigned int
i=0;i<scores.size();i++){
if(max<scores[i]){
max = scores[i];
}
}
return max;
}
int getMinimum(){
int min = 9999;
for(unsigned int
i=0;i<scores.size();i++){
if(min>scores[i]){
min = scores[i];
}
}
return min;
}
int getAverage(){
float total = 0;
for(unsigned int
i=0;i<scores.size();i++){
total +=
scores[i];
}
return total/scores.size();
}
bool ifAverageAbove75(){
float average = getAverage();
return average>=75;
}
};
int main()
{
AdjustedAssignment assign;
assign.setName("My Name");
assign.addScore(70);
assign.addScore(75);
assign.addScore(80);
assign.addScore(85);
assign.addScore(90);
int max = assign.getMaximum();
int min = assign.getMinimum();
float average = assign.getAverage();
int diff = 100-max;
int newMax = max+diff;
int newMin = min+diff;
float newAvg = average+diff;
cout<<"Adjusted Maximum is :
"<<newMax<<endl;
cout<<"Adjusted Minimum is :
"<<newMin<<endl;
cout<<"Adjusted Average is :
"<<newAvg<<endl;
return 0;
}
output:

Write a class AdjustedAssignment that has private attributes for Name and a vector of integers Scores....
Write a program that instantiates an array of integers named scores. Let the size of the array be 10. The program then first invokes randomFill to fill the scores array with random numbers in the range of 0 -100. Once the array is filled with data, methods below are called such that the output resembles the expected output given. The program keeps prompting the user to see if they want to evaluate a new set of random data. Find below...
write a class encapsulating the concept of a student assuming
that the student has the following attributes the name of student
the average of the student the
rite a class encapsulating the concept of a Student, assuming that the Student has the following attributes: the name of the student, the average of the student, and the student's GPA. Include a default constructor, an overloaded constructor, the accessors and mutators, and methods, toString() and equals(). Also include a method returning the...
Java Program 1. Write a class that reads in a group of test scores (positive integers from 1 to 100) from the keyboard. The main method of the class calls a few other methods to calculate the average of all the scores as well as the highest and lowest score. The number of scores is undetermined but there will be no more than 50. A negative value is used to end the input loop. import java.util.Scanner; public class GradeStat {...
Assignment W3-2 This programming assignment addresses: •Compiling and Executing an App with more than 1 class •Initializing Objects using Constructors •Software Engineering with Private Instances Variables and Public Set/Get Methods •Uses Methods inside classes Description: You are asked to write a program to process two students’ scores. Each student will have scores for 3 tests, the user will input each student’s full name followed by their three scores. When the data for the two students are read from the keyboard,...
Create a java project with the name Assignment3YourLastName in the folder COMP3110AssignmentsYourLastName Part-1 (use a nested-if-else statement) Add a static method with the name gradeLetter. This method will ask the user to enter an integer score and display the grade letter based on the rules: Score range Grade letter 90—100 A 80—89 B 70—79 C 60—69 D 0—59 F Part-2 (use a while statement) Add a static method with the name CalculateGrade. This method will ask the user to enter...
Write the definition of the class Tests such that an object of this class can store a student's first name, last name, five test scores, average test score, and grade. (Use an array to store the test scores.) Add constructors and methods to manipulate data stored in an object. Among other things, your class must contain methods to calculate test averages, return test averages, calculate grades, return grades, and modify individual test scores. The method toString must return test data...
please help asap in c++, you dont have to do everything but at least give me a starting idea of how this should look like Write a class Assignment that has private attributes for Name, Possible Points and Earned Points Write a class Student that has private attributes for name and a vector of assignments. The constructor method should require a name. Add a method for get total score that returns the total number of points earned divided by the...
IN JAVA (ECLIPSE) Design a TestScores class that has fields to hold three test scores. (If you have already written the TestScores class for programming challenge 8 of chapter 3, you can modify it.) the class constructor should accept three test scores as arguments and assign these arguments to the test score fields. The class should also have accessor methods for the test score fields, a method that returns the average of the test scores, and a method that returns...
Determine the average of test scores. When completing this question, remember the order of operations. Write a program that calculates an average of five test scores. The output will display the average test score. Get the first test score. Get the second test score. Get the third test score. Get the fourth test score. Get the fifth test score. Calculate the average by adding 5 test scores and dividing the sum by 5. Display the average. Make sure you add...
Write a grading program in Java for a class with the following grading policies: There are three quizzes, each graded on the basis of 10 points. There is one midterm exam, graded on the basis of 100 points. There is one final exam, graded on the basis of 100 points. The final exam counts for 40% of the grade. The midterm counts for 35% of the grade. The three quizzes together count for a total of 25% of the grade....