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
valina [46]
3 years ago
6

JAVA

Computers and Technology
1 answer:
ryzh [129]3 years ago
7 0

import java.util.Scanner;

public class JavaApplication33 {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     int total = 0;

     System.out.println("Enter positive numbers (-1 to stop)");

     while (true){

         

         int num = scan.nextInt();

         if (num == -1){

             break;

         }

         else{

             total += num;

         }

     }

     System.out.println("Sum is "+total);

     

}

}

I hope this helps!

You might be interested in
Please help with coding assignment.
Inessa05 [86]

Answer:

import java.util.Random;

class Main {

   

   public int stopAtFive (int j) {

      Random rand = new Random();

      int number = 0;

      for(int i=0; i<j; i++) {

          number = rand.nextInt(9)+1;

          System.out.println(number);

          if (number == 5) {

              System.out.println();

              break;

          }

      }

      return number;

   }

   

   public static void main(String args[]) {

       Main main = new Main();

       main.stopAtFive(20);

       main.stopAtFive(20);

   }

}

Explanation:

Your requirements do not say what has to be displayed or returned from the method, but you can use this as a starting point.

4 0
3 years ago
Linda installed a special pool for the hydrotherapeutic treatment of severe arthritis, as prescribed by her doctor. The cost of
stellarik [79]

Answer:

Linda is entitled to deduction (before any AGI limitations) of $896 in one year of installation of the pool.

Explanation:

Following is explained calculation for deduction (before any AGI limitations) that is Linda entitled to in the year of installation of the pool.

Given that:

Cost of Installing the pool = $22,400

Paid by insurance company = $5,600

So by deducting the price paid by insurance company from total cost the balance becomes:

Balance = $22,400 - $5,600 = $ 16,800

As the pool increased the value of house by $7,840 so we will deduct this amount from balance:

Balance = $ 16,800 - $7,840 = $8,960

As the useful life given for pool is 10 years so we will divide the balance with 10 to obtain the deduction amount for 1 year:

Deduction amount for one year = $8,960/10 = $8,96

Hence $8,96 will be deducted in one year installation.

i hope it will help you!

7 0
4 years ago
What is security in Technology<br>​
maria [59]

Answer:

IT security is a set of cyber security strategies that prevents unauthorized access to organizational assets such as computers, networks, and data.

3 0
4 years ago
Read 2 more answers
How are entries ordered in a reference list
neonofarm [45]

Answer:

idijajahgajjayzickdjdjd

5 0
3 years ago
Which client software can be used to connect remote Linux client into a Palo Alto Networks Infrastructure without sacrificing th
Sati [7]

Answer:

GlobalProtect Linux

Explanation:

GlobalProtect Linux can be used to connect remote Linux client into a Palo Alto Networks Infrastructure without sacrificing the ability to scan traffic and protect against threats.

3 0
4 years ago
Other questions:
  • What is the core of an operating system that manages memory and devices, maintains the computer’s clock, starts programs, and as
    7·1 answer
  • Inherent flaws in system software code are called:
    7·1 answer
  • Draw a logic circuit for the function F = (A + B)(B + C)(A + C), using NOR gates only. ​
    9·1 answer
  • Engineers and scientists redesign a prototype if it does not work correctly true or false and why
    10·2 answers
  • Choose the web design factor from the drop-down menus that best represents each statement. A. Good web pages stick to the point,
    15·1 answer
  • What does a capitalist economy allow people to do?
    11·2 answers
  • A small network used for communication between personal computing devices is known as?
    8·1 answer
  • A command, such as a button or keyboard shortcut, that performs a specific task is known as a
    9·2 answers
  • Question 7<br> What is the description of The Ribbon?
    14·1 answer
  • Who invented Satellites? What purpose does it serve? How has it impacted society today?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!