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
sertanlavr [38]
3 years ago
8

This the code from the last post I did

Computers and Technology
1 answer:
Andrew [12]3 years ago
3 0

import java.util.Scanner;

public class JavaApplication86 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       int x = 0, c = 0, sum = 0;

       while (true){

           x = scan.nextInt();

           System.out.println("You entered: "+x);

           if (x == -1){

               break;

           }

           sum += x;

           c++;

       }

       System.out.println("The sum is "+sum);

       System.out.println("You entered "+c +" numbers");

   }

   

}

This works for me. Instead of subtracting one from c and adding one to sum, I used an if statement to break away from the while loop if the entered number is -1.

You might be interested in
The phone in your hand is a computer. So too is the machine that occupies a 100,000 square foot data center. Given their vast di
Dmitry [639]

Answer:

Well when you think about it they both do the same thing but they are diffirent, they have the same perpose but diffirent parts in them so, when you compair them the phone is smaller and slower, the bigger the computer the better it is depending on the amount of money spent on parts.

5 0
3 years ago
How could you insert a new row between rows 20 and 21?
love history [14]
<span>The Answer is C. Right-click row 21's row number, and then click Insert.

</span>
6 0
2 years ago
Read 2 more answers
What is an example of fibre optic cable<br>​
Arte-miy333 [17]

Answer:

printing cable

Explanation:

is a cable used to transfer information from a computer to the printer in packages

5 0
2 years ago
The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
victus00 [196]

Answer:

The answer is "Option a"

Explanation:

The given question is incomplete, that's why its correct solution can be defined as follows:

The above-given question is the part of the Binary Autocomplete, in which this Autocomplete function would be a full word or sentence after just a few other letters were entered into the system. It approach improves text taking appropriate on smartphone devices of particular because every letter should not be written in such a single phrase.  

3 0
3 years ago
Zachary was frustrated. His computer was running very slowly and he was worried that it was reducing his productivity on the job
Irina18 [472]

Literally QuickTime....I hate brainly

4 0
3 years ago
Other questions:
  • Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_di
    9·1 answer
  • major m,ajorrr points helpppppppppppppppppppppppppppi have a question i hit a few buttons and now my computer is saying everythi
    11·2 answers
  • You can use ???? a to test tread wear on your tires
    14·2 answers
  • Which one of the following is NOT true about energy conversion devices? Group of answer choices Total Energy Input = Energy Diss
    8·1 answer
  • Assuming you have a TCF free student checking account, how many maximum overdraft fees can you incur in one day?
    12·1 answer
  • Why did artists use pinhole cameras during the renaissance?
    8·1 answer
  • Steve left his computer switched on in his room and went out to have breakfast. When he returned, he saw that the monitor had be
    9·1 answer
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • What is the first things u do upon seeing this sheet?​
    14·2 answers
  • Data from RAM may be placed where to free up space? Log file Swap file Word file Print spool file
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!