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
On dynamic disks, the term partition is not used to define the space where a file system is installed. what term is used?
Mamont248 [21]

Answer:

For dynamic disks, the term volume is used to define the space where a file system in installed.

Explanation:

A volume is defined as the storage area extracted from free space or say unused space. A file system is used to format a volume or to assign it a drive name.

Five types of volumes are supported by dynamic disks. They are as follows:

  • Simple Volumes
  • Mirrored volumes
  • Striped volumes
  • Spanned volumes
  • RAID-5 volumes
3 0
3 years ago
Straight dinosaur walks out of woods : RAWWRRRR
Lena [83]

Answer:

These type of people on brainly are what I live for L M A O

Explanation:

4 0
3 years ago
Read 2 more answers
When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
seropon [69]

Explanation:

Using this technique a number is represented in bits by three parts: sign, exponent, and fraction. This is similar to scientific notation used to represent large or small numbers (e.g. ). The sign is negative, the exponent is 8 and the fraction is 0.35.

8 0
3 years ago
Under which condition below would you expect a glassy extrusive rock like obsidian to form?
agasfer [191]
Hihi!

The correct answer would be D. Quick cooling on Earth's surface! Obsidian is<span>a volcanic rock formed by the rapid solidification of lava without crystallization!

I hope I helped!
-Loliarual
</span>
7 0
4 years ago
Read 2 more answers
Below you will find the requirements to identify the Account Diversity Grade of a user. Read the requirements carefully and iden
igomit [66]

The technique I used to test the requirement is equivalence partitioning.

<h3>Equivalence Partitioning-</h3>

Generic test data is considered where all the test data satisfies the conditions provided in the problem. Such that,

- ADGrade A --> TA=25 LC=5

- ADGrade B --> TA=20, LC=3

- ADGrade C --> TA=8 LC=2

- ADGrade D --> TA=2, LC=1

- ADGrade null (n/a)—> TA=0, LC=0

Where:

  • TA represents totalAccounts,
  • LC represents loanTypeCount,
  • ADGrade represents accountDiversityGrade

If we are to combine the test data collected above, we would obtain the entire set of test data.

With this in mind, the minimum number of users that are required for testing the requirement is 5.

Read more about requirement testing here:

brainly.com/question/16147055

#SPJ1

8 0
2 years ago
Other questions:
  • In terms of Technology software is defined as?
    11·2 answers
  • Which one of them are the correct answers?
    7·1 answer
  • What is Brainly?<br><br> A.Yes<br> B.No
    12·2 answers
  • The function of network switch is to _____.
    5·1 answer
  • From a database point of view, the collection of data becomes meaningful only when it reflect
    8·1 answer
  • True or False: Nanomemory applies to computers.
    13·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    7·1 answer
  • What is meant by astigmation​
    9·2 answers
  • Cho 1 biến x thuộc kiểu dữ liệu Integer , hãy cho biết biến x dùng để làm gì?
    7·1 answer
  • Describe the differences and similarities between the most common operating systems used for Mac, PC, and Linux in
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!