1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kolbaska11 [484]
3 years ago
11

Array testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cre

dit is 100, so anything over 100 is extra credit. Ex: If testGrades = {101, 83, 107, 90}, then sumExtra = 8, because 1 + 0 + 7 + 0 is 8.
Computers and Technology
1 answer:
Tresset [83]3 years ago
5 0

Answer: The program in c++ language for the given scenario is given below.

#include <iostream>

using namespace std;

int main() {    

int sumExtra = 0, len;

int testGrades[len];

// this input determines the length of the array

cout<<"Enter the number of grades to be entered : ";

cin>>len;

 

for(int j=0; j<len; j++)

{

    cout<<endl<<"Enter grade "<<j+1;

    cin >> testGrades[j];

}

 

for(int i=0; i<len; i++)

{

    if(testGrades[i] > 100)

        sumExtra =  sumExtra + ( testGrades[i] - 100 );

    else

        continue;

}

cout<<endl<<"Sum of extra credit = " << sumExtra;

return 0;

}

Explanation:

Header files are imported for input/ output alongwith the namespace.

#include <iostream>

using namespace std;

All variables and array is declared of type integer.

int sumExtra = 0, len;

int testGrades[len];

User is prompted for the number of grades to be entered. This number is stored in variable len, which determines the length of the array, testGrades.

testGrades[len];

Using for loop, grades are entered for each index.

for(int j=0; j<len; j++)

{

     cout<<endl<<"Enter grade "<<j+1;

     cin >> testGrades[j];

}

Using another for loop and if-else statement, if the grade > 100, extra credit is added and sum is stored in the variable, sumExtra.

for(int i=0; i<len; i++)

{

     if(testGrades[i] > 100)

          sumExtra =  sumExtra + ( testGrades[i] - 100 );

     else

          continue;

}

This is followed by displaying the message with sum of the extra credit.

The main() function has the return type int. Hence, integer 0 is returned at the end of the program.

In the above, endl keyword is used to insert break line. The following message will be displayed on the new line. This is another alternative for the newline character, \n.

The given program does not implements a class since the logic is simple. Also, the question does not specify that the class and object should be used.

You might be interested in
What is a good range for CPU usage to be considered running well?
densk [106]

Answer:

Normal CPU usage is 2-4% at idle, 10% to 30% when playing less demanding games, up to 70% for more demanding ones, and up to 100% for rendering work. When watching a video it should be around 5% up to 15% (total), depending on your CPU, browser and video quality

3 0
2 years ago
Which professionals can benefit from an understanding of statistics? Check all of the boxes that apply. magician trying to locat
mojhsa [17]

Answer:

All 3 of them

Explanation:

8 0
3 years ago
Read 2 more answers
How do you mark peoples answer as the brainliest answer? I have trouble doing so. Please help!
Lubov Fominskaja [6]

You need to have more than one answer.


4 0
3 years ago
Read 2 more answers
The best defenses against covert channels include IDS and intrusion prevention system (IPS) and thoroughly watching all aspects
ddd [48]

Answer:

The statement is True

Explanation:

When talking about computer security, we can define covert channels as an attack on a system capable of creating a loophole for information objects transfer between various processes that would normally not allow communication under the computer security policy. Hence, the best defenses system against this kind of attack is via Intrusion Defense System and Intrusion Prevention System and relentlessly "watching all aspects of an IT infrastructure for aberrant or abnormal events of any type."

7 0
3 years ago
? Assessment
Ksivusya [100]

Answer:

Her performance over the course of  a season.

Explanation:

An athlete is signed for a season. These days each aspect of an athlete is noted through the effective use of the best technology. However, for detailed study, one or several plays, and certainly not the second half of a game is enough. It's required to collect the details for a complete season. And that is possible, as an athlete is hired for a season. And through such a detailed data set of a complete season, we can now train a machine as well, and it will let the athlete know where she is going wrong. And thus she can improve and remove those faults from her game, and become a better athlete. And even for a coach, one complete season is required, though when he has not seen her playing before that season. It's assumed that this is her first season. All the options mentioned are good, but the best is certainly the one with complete details, and that is a complete season. The rest is good but not the best.

4 0
3 years ago
Other questions:
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • The area on your screen where you can access the tab and menu options for word is called what?
    8·2 answers
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • How are IP addresses usually written?
    7·1 answer
  • How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
    5·1 answer
  • / Looks up author of selected books
    15·1 answer
  • ANSWER ASAP!!!!!
    10·2 answers
  • Write a programmer defined function that compares the ASCII sum of two strings. To compute the ASCII sum, you need to compute th
    6·1 answer
  • What applications would you pin to your taskbar, why?
    15·1 answer
  • when I turn on my pc using a graphics card, it does give video, and everything is normal, but when I try to turn on my pc with t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!