answer.
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
NARA [144]
2 years ago
3

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
Computers and Technology
2 answers:
Sidana [21]2 years ago
6 0

Answer:

/**

a for loop that sets sumExtra to the total extra credit received.

**/

import java.util.Scanner;

public class SumOf Excess {

public static void main (String [

args) {

final int NUM_VALS

int [] testGrades = 4;

new int [NUM_VALS];

int i;

int sumExtra = -9999;

/** Assign

sumExtra with 0 before your

for loop**/

testGrades [0] = 101;

testGrades [ 1] = 83;

testGrades [2] = 107;

testGrades [3] = 90;

sumExtra = 0;

for(i = 0 ;i < testGrades.length

:++i){

if(testGrades [i]> 100){

testGrades [i] = sumExtra - 100+ SumExtra;

}

else {

System.out.println("sumExtra:

sumExtra);

}

}

Explanation:

total extra credit received. Full credit

is 100, SO anything over 100 is

extra credit.

Ex If testGrades = {101, 83, 107, 90

then sum Extra = 8, because 1 +0+ 7

+0 is 8.

Kruka [31]2 years ago
3 0

Complete Question:

Array 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."

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class SumOfExcess {

   public static void main (String [] args) {

       Scanner in = new Scanner(System.in);

       final int NUM_VALS = 5;

       int[] testGrades = new int[NUM_VALS];

       int sumExtra = 0;

       System.out.println("Enter the test scores for the five courses");

       testGrades[0]= in.nextInt();

       for(int i =1; i<testGrades.length; i++){

           System.out.println("Enter next score");

           testGrades[i]= in.nextInt();

       }

       System.out.println("The test scores are "+ Arrays.toString(testGrades));

//Finding the sum of excess credit

       for(int i = 0 ;i < testGrades.length; ++i){

           if(testGrades[i] > 100){

               sumExtra = testGrades[i] - 100 + sumExtra;

           }

           else {

           }

       }

       System.out.println("Total sumExtra: " + sumExtra);

   }

}

Explanation:

  • This has been solved using Java programming language
  • create the array of type int and of length NUM_VALS in this case 5 int[] testGrades = new int[NUM_VALS];
  • Use a for loop to request user to enter the values for the credits
  • Use Java's Arrays.toString Method to display the array after all the values have been entered
  • Create and initialize the variable sumExtra
  • Using a second for loop iterate the entire array, using an if statement determine values above 100, subtract the extra value and add to the variable sumExtra

You might be interested in
What prevents someone who randomly picks up your phone from sending money to themselves using a messenger-based payment?
Gekata [30.6K]

Answer:

Explanation:

There are various safety features in place to prevent such scenarios from happening. For starters phones usually have a pin code, pattern code, or fingerprint scanner which prevents unauthorized individuals from entering into the phone's services. Assuming that these features have been disabled by the phone's owner, payment applications usually require 2FA verification which requires two forms of approval such as email approval and fingerprint scanner in order for any transactions to go through. Therefore, an unauthorized individual would not have access to such features and would not be able to complete any transactions.

6 0
2 years ago
c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
Lilit [14]

The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.

#include<stdio.h>

#include<string.h>

 int* uniqueValue(int input1,int input2[])

 {

   int left, current;

   static int arr[4] = {0};

   int i      = 0;

     for(i=0;i<input1;i++)

      {

         current = input2[i];

         left    = 0;

         if(current > 0)

         left    = arr[(current-1)];

      if(left == 0 && arr[current] == 0)

       {

       arr[current] = input1-current;

       }

       else

   {

       for(int j=(i+1);j<input1;j++)

       {

           if(arr[j] == 0)

           {

               left = arr[(j-1)];

               arr[j] = left - 1;

           }

       }

   }

}

return arr;

}

4 0
2 years ago
You learned that properly edited resumes are necessary for making a good impression on a university or a potential employer. Dis
Daniel [21]

Answer:

it will not be a good impression and it will be hard to look for a job

Explanation:

3 0
2 years ago
What is one effective way for employees to keep their skillsets current?
lys-0071 [83]
They are probably looking for B.  subscribing to journals is a good way of keeping up with what's happening in any field.

Of course, a very carefully curated professional network online is great for this too (but they said "personal" so that's not the answer)

Employers generally prefer that employees WORK as often as possible, so even though JUDICIOUS use of social media is a great way to keep current, D isn't the answer either.

Blogging about personal experiences is not necessarily going to teach you anything about work, though blogging professionally can be useful in gathering response from your readership
4 0
2 years ago
Read 2 more answers
Suppose you are given an unknown chip which could be any one of the of the following: 7400, 7402, 7404, 7408, 7410, 7420, 7427,
Olenka [21]

The answer & explanation for this question is given in the attachment below.

3 0
2 years ago
Other questions:
  • What language(s) must be used to display a bare-minimum web page?
    9·2 answers
  • Select the correct answer. Rachel needs to make a presentation on ethics and etiquettes in college. She has about 30 minutes to
    13·1 answer
  • Write a C++ program that prompt the user to enter three points (x1, y1), (x2, y2), (x3,y3) of a triangle and displays its area.
    15·1 answer
  • The main problem with radio transmission is which of the following? Select one: a. Radio waves cannot travel through walls. b. W
    9·2 answers
  • The OSI security architecture provides a systematic framework for defining security attacks, mechanisms, and services. True or F
    12·1 answer
  • What data discovery process, whereby objects are categorized into predetermined groups, is used in text mining?
    9·1 answer
  • What will be the output of the following Python code? class A: def test1(self): print(" test of A called ") class B(A): def test
    15·1 answer
  • Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
    7·1 answer
  • Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai
    11·1 answer
  • A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!