subject

Vector testgrades contains num_vals test scores. write a for loop that sets sumextra to the total extra credit received. full credit 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.

import java. util. scanner;

public class sumofexcess {
public static void main (string [] args) {
final int num_vals = 4;
int[] testgrades = new int[num_vals];
int i = 0;
int sumextra = -; // initialize to 0 before your for loop

testgrades[0] = 101;
testgrades[1] = 83;
testgrades[2] = 107;
testgrades[3] = 90;

/* your solution goes here */

system. out. println("sumextra: " + sumextra);

return;
}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, Thisisdifinite
Which of the following would you find on a network
Answers: 3
image
Computers and Technology, 23.06.2019 06:30, wwesuplexcity28
To become an audio technician, the most successful tactics might include the following. (select all that apply). learning how to persuade other people gaining different types of experience in audio technology learning as much as possible about art history establishing a reputation as a reliable professional
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, danielcano12281621
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
image
Computers and Technology, 23.06.2019 22:30, reaganphelps3
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
You know the right answer?
Vector testgrades contains num_vals test scores. write a for loop that sets sumextra to the total ex...

Questions in other subjects:

Konu
Mathematics, 23.05.2021 14:30
Konu
History, 23.05.2021 14:40