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
It is also called teleconferencing or web conferencing,which is an online meeting wherein two or more people can see,hear,and ta
netineya [11]

Answer:

This is a Answer Not  Question... But Answering it to explain what it is.

Explanation:

3 0
3 years ago
How many Iron molecules are in the compound Fe4O2?
Greeley [361]

Explanation: Determine the mass of the substance, and its molar mass. Divide the given mass by its molar mass to get moles, then multiply times 6.022×1023molecules1mol

5 0
3 years ago
Read 2 more answers
Create an application that allows a user to enter values for an array of seven Salesperson objects. Offer the user the choice of
Svetradugi [14.3K]

Answer:

Following are the class "SalespersonSort" code to this question:

public class SalespersonSort //defining a class SalespersonSort

{

public static void main(String[] ax) //defining a main method  

{

int id;//defining integer variable

double sales; //defining double variable

String select;//defining String variable

Salesperson[] x = new Salesperson[7]; //crating array as the Salesperson class

Scanner x1= new Scanner(System.in);//creating scanner class object

for(int i=0; i<x.length; i++)//defining loop for input values

{

System.out.print("Enter ID number "+(i+1)+": ");//print message

id = x1.nextInt();//input value

System.out.print("Enter Annual Sales "+(i+1)+": ");//print message

sales = x1.nextDouble(); //input value

x[i]=new Salesperson(id,sales);//hold value in array x

}

System.out.println("Do you want to sort by ID or sales? (Enter ID or sales):");//print message

select= x1.next();//input value

if(select.equalsIgnoreCase("ID"))//define if block that sort value by id

{

for(int i=0; i<x.length; i++)//define for loop to collect value

{

int m= i;//use integerv variable to hold i value

for(int j=i; j<x.length; j++)//define for loop to sort value

{

if(x[j].getID() < x[m].getID())//use if block for check value

m = j;//use integerv variable to hold j value

}

//perform swapping

Salesperson t = x[i];//define calss type variable t to hold aaray value

x[i] = x[m];//inter change value

x[m] = t;//store value in x

}

System.out.println("Sales sorted by ID are ");//print message

for(int i=0; i<x.length; i++)//define for loop to print sort value

System.out.println(x[i]);//print value

}

else//defining else block

{

for(int i=0; i<x.length; i++)//define for loop to collect value

{

int m= i;//use integerv variable to hold i value

for(int j=i; j<x.length; j++)//define for loop to sort value

{

if(x[j].getAnnualSales() < x[m].getAnnualSales())//sort value by sales

m = j;//hold j value in m

}

//perform swapping

Salesperson t = x[i];//define calss type variable t to hold aaray value

x[i] = x[m];//inter change value

x[m] = t;//store value in x

}

System.out.println(" sort value by Annual Sales: "); //print message

for(int i=0; i<x.length; i++)//defining for loop to print value

System.out.println(x[i]);//print value

}

}

}

output:

please find the attached file.

Explanation:

In the above-given code, a class "SalespersonSort" is defined, inside the class main method is defined, in the method three variables "sales, select, and id" is defined, that is datatype different.

In the class, Salesperson as an array is defined and a scanner class object created that inputs array values and in the string value and a conditional statement is used.

In the if block, it sort values according to id value, and in the else block it sort value according to sales value.  

please find the attachment of full code.

7 0
3 years ago
Enter just the letter of the correct answer
FromTheMoon [43]
The correct answer is firewall
7 0
3 years ago
Do mouse cable connect to a PS/2 or USB port?
kozerog [31]

Answer:

USB port

Explanation:

A  mouse cable connects to a USB port.

You are able to remove it from your computer if needed and put it into a different computer or device.

8 0
4 years ago
Read 2 more answers
Other questions:
  • 2
    9·2 answers
  • What symbol do we use to denote a character?
    9·2 answers
  • You will be given a grocery list, followed by a sequence of items that have already been purchased. You are going to determine w
    7·1 answer
  • A(n) ________ is a web application that allows users to easily add and edit content on a web page.
    15·1 answer
  • Match the metric units with these measurements
    8·1 answer
  • Select all that apply
    14·1 answer
  • Josephine is in the process of creating ads within her Standard Display campaign. She finds that there are two main ad formats t
    15·1 answer
  • Midday is a good time to take a portrait outside.<br> true or false?
    8·1 answer
  • Why does your e-learning course need a title slide?
    10·2 answers
  • Firestick optimizing system storage and applications
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!