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]
2 years ago
8

This the code from the last post I did

Computers and Technology
1 answer:
Andrew [12]2 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
What could cause this? An App Builder wants to show Groups as the last navigation menu item in the Salesforce1 Mobile App. Howev
sasho [114]

Answer:

Option B is the correct option.

Explanation:

In the above scenario, When they wanted to demonstrate Groups as the last menu item for navigation in the Mobile App. Then, they can't select Groups as among the elements in the drop-down menu though.

So, the following scenario causes that the Groups are not contained in the selected list for the navigation menu.

4 0
3 years ago
Ximena noticed that Sofia had created a network bridge on her new laptop between the unsecured wireless network and the organiza
ratelena [41]

Answer:

A bridge could permit access to the secure wired network from the unsecured wireless network

Explanation:

A bridge is connecting device in networking that connects two different network devices. This device is suitable to connect a secure network with an unsecured network.

8 0
3 years ago
Someone who wants the credential of skilled training but in less time than a four-year degree should consider
Katyanochek1 [597]
They should consider an associates degree or certifications. =)
8 0
3 years ago
Is it always best for a company to make decisions based on data, or are there some situations where they should not focus on dat
Serhud [2]

Answer:

data-driven decision

Explanation:

While 91% of companies say that data-driven decision-making is important to the growth of their business, only 57% of companies said that they base their business decisions on their data. Data-driven decision-making is a great way to gain a competitive advantage, increase profits and reduce costs!

6 0
3 years ago
Mail merge can be used in business to complete which of the following tasks
Likurg_2 [28]

Answer:

Mail merge lets you create a batch of documents that are personalized for each recipient. For example, a form letter might be personalized to address each recipient by name. A data source, like a list, spreadsheet, or database, is associated with the document.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Candace opened an email from a person she didn't know and clicked on a pop-up in the email that installed a virus on her compute
    8·2 answers
  • Select all that apply. Hyperlinks can appear as: words pictures symbols trademarks
    12·2 answers
  • What are the principal cybersecurity threats, both internal and external, and the principal safeguards that have been developed
    13·1 answer
  • The design of a blog refers to:
    10·1 answer
  • The construction of a mixed media assemblage would be considered
    9·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
  • Use a while loop to output the even number from 100 to 147? This is python
    10·1 answer
  • Which step do you think is most useful from big data life cycle.why?
    9·1 answer
  • For which tasks is Layout view most helpful? Check all that apply.
    12·1 answer
  • which of the following is the most appropriate way to write css style for the font family property in html
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!