Hello I'm working on C++. I'm not really sure how to add arrays and what to add in void getGrades. Program Requirements: Use two arrays of doubles for the grades. Use a global constant for the max size of the arrays Use a void function called GetGrades that accepts a single argument (one array) and prompts the user for grades to enter. Use a boolean function called GradesAreSame that accepts two arguments (both arrays) as constant parameters. It should return true if both arrays are the same and false if the arrays are different.

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter14: Exploring Object-based Programming: Designing An Online Poker
Section14.1: Visual Overview: Custom Objects, Properties, And Methods
Problem 7QC
icon
Related questions
Question

Hello I'm working on C++. I'm not really sure how to add arrays and what to add in void getGrades.

Program Requirements:

  1. Use two arrays of doubles for the grades.
  2. Use a global constant for the max size of the arrays
  3. Use a void function called GetGrades that accepts a single argument (one array) and prompts the user for grades to enter.
  4. Use a boolean function called GradesAreSame that accepts two arguments (both arrays) as constant parameters. It should return true if both arrays are the same and false if the arrays are different.
1. Sample run 1
Getting Student One
Enter grade: 5
Enter grade: 5
Enter grade: 0
Enter grade: 0
Enter grade: 7
Getting Student Two
Enter grade: 3
Enter grade: 3
Enter grade: 0
Enter grade: 0
Enter grade: 7
Both students have the SAME grades!
2. Sample Run 2
Getting Student One
Enter grade: 100.00
Enter grade: 98.87
Enter grade: 87.00
Enter grade: 77.98
Enter grade: 33.23
Getting Student Two
Enter grade: 100.00
Enter grade: 97.87
Enter grade: 33.23
Enter grade: 87.00
Enter grade: 77.98
Both students have DIFFERENT grades!
3. Sample Run 3
Getting Student One
Enter grade: 98.2
Enter grade: 88.3
Enter grade: 77.0
Enter grade: 100.2
Enter grade: 98.1
Getting Student Two
Enter grade: 98.2
Enter grade: 88.3
Enter grade: 77.0
Enter grade: 100.2
Enter grade: 98
Both students have DIFFERENT grades!
Transcribed Image Text:1. Sample run 1 Getting Student One Enter grade: 5 Enter grade: 5 Enter grade: 0 Enter grade: 0 Enter grade: 7 Getting Student Two Enter grade: 3 Enter grade: 3 Enter grade: 0 Enter grade: 0 Enter grade: 7 Both students have the SAME grades! 2. Sample Run 2 Getting Student One Enter grade: 100.00 Enter grade: 98.87 Enter grade: 87.00 Enter grade: 77.98 Enter grade: 33.23 Getting Student Two Enter grade: 100.00 Enter grade: 97.87 Enter grade: 33.23 Enter grade: 87.00 Enter grade: 77.98 Both students have DIFFERENT grades! 3. Sample Run 3 Getting Student One Enter grade: 98.2 Enter grade: 88.3 Enter grade: 77.0 Enter grade: 100.2 Enter grade: 98.1 Getting Student Two Enter grade: 98.2 Enter grade: 88.3 Enter grade: 77.0 Enter grade: 100.2 Enter grade: 98 Both students have DIFFERENT grades!
3 #include <iostream>
0
7
8
9
10
11
12
13
14
15
10
17
18
19
27 v
28
29
30
31
32
ww
20 bool GradesAreSame(){
21
float grade1;
22
float grade2;
23
float grade3;
24
float grade4;
23
float grade5;
20
33
34
35
wwww
void GetGrades (double &);
bool GradesAreSame(int, double);
30
37
38
39
int main() {
std::cout << "Hello World!\n";
GetGrades (double);
GradesAreSame(int, double);
}
void GetGrades (){
}
}
for (int i = 0; i < 5; i++){
std::cout<<"Enter grade: \n";
std::cin>> grade1;
std::cout << "Enter grade: \n";
std::cin>> grade2;
std::cout<<"Enter
grade: \n";
std::cin>> grade3;
std::cout<<"Enter
grade: \n";
std::cin>> grade4;
std::cout << "Enter grade: \n";
std::cin>> grades;
}
Transcribed Image Text:3 #include <iostream> 0 7 8 9 10 11 12 13 14 15 10 17 18 19 27 v 28 29 30 31 32 ww 20 bool GradesAreSame(){ 21 float grade1; 22 float grade2; 23 float grade3; 24 float grade4; 23 float grade5; 20 33 34 35 wwww void GetGrades (double &); bool GradesAreSame(int, double); 30 37 38 39 int main() { std::cout << "Hello World!\n"; GetGrades (double); GradesAreSame(int, double); } void GetGrades (){ } } for (int i = 0; i < 5; i++){ std::cout<<"Enter grade: \n"; std::cin>> grade1; std::cout << "Enter grade: \n"; std::cin>> grade2; std::cout<<"Enter grade: \n"; std::cin>> grade3; std::cout<<"Enter grade: \n"; std::cin>> grade4; std::cout << "Enter grade: \n"; std::cin>> grades; }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning