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
grin007 [14]
3 years ago
13

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
import java.util.Scanner; 3 public class SumoFExcess ( 4 public static void main (String [ args) ( Scanner scnr -new Scanner (System.in); final int NUM VALS -4 int[] testGrades-new int[NUM VALS]; int ij int sunExtra 9999; 11 Assign sunExtra with 0 before your for loop 10 for (i-0; ǐ < testGrades.length; +.1) { testGrades[1]-scnr.nextInt) 12 14 15 / Your solution goes here 16 System.out.printin("sumExtra:sumExtra);
Computers and Technology
1 answer:
Soloha48 [4]3 years ago
5 0

Answer:

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

13.           if (testGrades[i] > 100){

14.              sumExtra = sumExtra + testGrades[i] - 100;}

15.       }

Explanation:

We first iterate through the entire testGrades array. For each test score that is in testGrades ( that is testGrades[i] ), we see whether or not the test grade is above 100 (See line 12) . If test grade is greater than 100, this means we have extra credit. We simply subtract 100 from the test grade, add it with the previous value of sumExtra and store the value back in sumExtra(see line 14). Once i is greater than the length of the test grades, the loop is exited. We can now print sumExtra to obtain the result.

You might be interested in
Write a public member function which replace that replaces one occurrence of a given item in the ArrayBag with another passed as
ira [324]

Answer:

The method is written in Java

public static boolean abc(int [] ArrayBag,int num, int replace){

    Boolean done = false;

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

        if(ArrayBag[i] == num){

            ArrayBag[i] = replace;

            done = true;

        }

    }

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

        System.out.println(ArrayBag[i]+" ");

    }

    return done;

}

Explanation:

The method is written in java

The arguments of the method are:

<em>1. ArrayBag -> The array declares as integer</em>

<em>2. num -> The array element to check the presence</em>

<em>3. replace - > The replacement variable</em>

This line defines the method as boolean.

public static boolean abc(int [] ArrayBag,int num, int replace){

This line declares a boolean variable as false

    Boolean done = false;

The following iterates through the elements of the array

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

This checks if the array element exist

        if(ArrayBag[i] == num){

If yes, the array element is replaced

            ArrayBag[i] = replace;

The boolean variable is updated from false to true

            done = true;

        }

    }

The following iteration prints the elements of the array

<em>     for(int i = 0;i<ArrayBag.length;i++){</em>

<em>         System.out.println(ArrayBag[i]+" ");</em>

<em>     }</em>

This prints returns the boolean thats indicates if replacement was done or not.

    return done;

}

<em>Attached to this solution is the program source file that includes the main method of the program</em>

Download txt
5 0
3 years ago
Which stage best represents the developing of documents that provides the basis for acquiring the resources and for developing a
UkoKoshka [18]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is the planning stage. Because the planning stage represents the development of documents that provide the basis for acquiring the resources and for developing the requirement document. at this stage, you plan about what you are going to develop and how to develop it. At this stage, you come out mainly with two documents i.e. project proposal and requirement document.

Other options are not correct because:

In the project management, after planning, you will start designing the product, and after designing you start developing the product, and at the implementation stage, you implement or deploy the product to the customer or to the client. The requirement document that is developed at the planning stage can be used in the later stages of the project.

7 0
3 years ago
4. How can a document's organization help us better understand the document's purpose?​
Ad libitum [116K]

Answer:

a document organization can help because it's organized and easy to read on a document.

6 0
2 years ago
Imprisonment for a first DUI conviction is not more than ___
lawyer [7]
Up to 6 months and a $500-$2000 fine
7 0
3 years ago
Anyone help me please<br># help # be care #​
nikdorinn [45]

2. Telecommunications, also known as telecom, is the exchange of information over significant distances by electronic means and refers to all types of voice, data and video transmission. ... A complete, single telecommunications circuit consists of two stations, each equipped with a transmitter and a receiver.

3. Data transmission and data reception or, more broadly, data communication or digital communications is the transfer and reception of data in the form of a digital bitstream or a digitized analog signal over a point-to-point or point-to-multipoint communication channel.

I HOPE IT'S HELP :)

3 0
2 years ago
Other questions:
  • On a DTP project, Morgan is preparing digital files to be sent to a printer. Which word describes the activity that Morgan is pe
    5·2 answers
  • The highly advanced decision support feature integrated within an electronic information system would support which activity?
    9·1 answer
  • NEED THIS NOW PLEASE!!!! (I AM NOT JOKING I HAVE TO SUBMIT IN 5 MINUTES)
    13·2 answers
  • There are a few simple rules that you can follow to store and manage files and folders in your computer. What is the most import
    9·2 answers
  • I have to make a online presentation, which program is the best
    10·2 answers
  • DTE just installed 500kW of solar capacity on the MCCC campus. the cost of the installation was about $3 million. what was the c
    10·1 answer
  • What is the best approach to testing a website? visit all pages to verify that they load visit every page and verify all links v
    7·1 answer
  • Rosanna is a middle school teacher. She has installed a spreadsheet program in her computer that tracks the grades and attendanc
    10·1 answer
  • You are given a graph G = (V, E) with positive edge weights, and a minimum spanning tree T = (V, E’) with respect to these weigh
    14·1 answer
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!