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
Pavlova-9 [17]
3 years ago
12

Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.

Computers and Technology
1 answer:
inna [77]3 years ago
7 0

Answer:

sum = 0 must be before for loop. If inside for loop, it will keep resetting sum to 0 each iteration.

Explanation:

hope this helps

You might be interested in
Write a class called Line that represents a line segment between two Points. Your Line objects should have the following methods
mel-nik [20]

Answer:

import java.awt.Point;

public class Line{

private Point point1, point2;

public Line(Point p1, Point p2){

point1 = p1;

point2 = p2;

}

public Point getP1(){

return point1;

}

public Point getP2(){

return point2;

}

public String toString(){

return "[( The " + point1.x + "," + point1.y + "), (" + point2.x + "," + point2.y +")]";

}

public static void main(String args[]){

Line lineObj = new Line(new Point(7,9), new Point(6,2));

System.out.println(lineObj.toString());

}

}

Explanation:

  • Declare the points inside the class Line.
  • Initialize the getters and setters method for the class.
  • Define a toString method that returns the information in a formatted manner.
  • Inside the main method, initialize an object with some values.
  • Display the information by calling the toString method.
4 0
2 years ago
What is the output from this program? #include void do_something(int *thisp, int that) { int the_other; the_other = 5; that = 2
Ostrovityanka [42]

Answer:

  1  35

Explanation:

* There is a little typo in printf. It should be "\n".

Initially, the value of the first is 1, and the value of the second is 2. Then, do_something(&second, first) is called. The value of the <em>first</em> will still be 1. However, there is a call by reference for <em>second </em>variable. That means the change made by the function <em>do_something</em> will affect the value of the <em>second</em> variable.

When you look at the calculation inside the <em>do_something</em> function, you may see that value of the <em>second</em> will be 35.

7 0
3 years ago
Comment on the following 2 arrays. int *a1[8]; int *(a2[8]); a1 is pointer to an array; a2 is array of pointers a1 is pointer to
Hitman42 [59]

Answer:

The answer is "a1 and a2 is an array of pointers".

Explanation:

In this question, A collection of pointers refers to an array of elements where each pointer array element points to a data array element. In the above-given statement, the two-pointer type array "a1 and a2" is declared that holds the same size "8" elements in the array, and each element points towards the array's first element of the array, therefore, both a1 and a2 are pointer arrays.

5 0
3 years ago
If the list [8,1,4,2,10,0] is sorted with the selection sort algorithm, what is the list at the 4th step of the algorithm?
Savatey [412]

Answer:

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

Explanation:

The selection sort algorithm step started from 0, and continue till the sorting is done.

The correct answer after selection sort algorithm at the 4th step is:D

[0,1,2,4,8,10].

The complete detail of step by step execution is shown in the attached document file.

Download docx
5 0
2 years ago
Cyber security class i need help​
makkiz [27]

Answer:

Explanation:

yooooo it b

5 0
2 years ago
Other questions:
  • In Florida, you can drive a motorcycle if you have a _____.
    8·1 answer
  • A database is used instead of a spreadsheet when?
    7·1 answer
  • A major difference between digital librarians and traditional librarians is that traditional librarians rarely work with people.
    15·2 answers
  • A lookup field allows the user to select from a list of values when updating the contents of a field. true or false.
    11·1 answer
  • What data discovery process, whereby objects are categorized into predetermined groups, is used in text mining?
    9·1 answer
  • How to measure potential energy of a ball?
    14·1 answer
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • Assume phrase= "Peter Piper picked a peck of pickled peppers", What will be returned if phrase.search(/[aeiou]/) is called?
    9·1 answer
  • A source mainly provides <br> from a text or piece of media.
    6·2 answers
  • Add me on Fortn!te <br> TsarBacon (imma girl)
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!