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

JAVA

Computers and Technology
1 answer:
ryzh [129]2 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
Assume that a single page of printed text requires 52 lines of text, and that each line of text averaged 80 characters. If each
zysi [14]

Answer:

4160000 bytes

Explanation:

One page = 52 lines of text

One line of text = 80 characters

=> One page = 80 x 52 = 4160 characters

Therefore, 500 pages of text will have 4160 x 500 characters = 2080000 characters.

Since 1 character takes up 2 bytes of computer memory, it impleies that a 500 page novel will take up 2080000 x 2 bytes = 4160000 bytes.

5 0
3 years ago
What is it called when you let the mouse pointer pause for a moment or two over an item?
katovenus [111]

When you let the mouse pointer pause for a moment or two over an item, it is called Hovering. Hovering means positioning the pointer to a specific object without clicking yet any mouse buttons. You also do not move it for at least a second. Hovering the mouse pointer may have the targeted object display its infotip or tooltip. 

8 0
3 years ago
For the following code, if the input is negative, make numitemsPointer be null. Otherwise, make numitemsPointer point to numitem
weeeeeb [17]

Answer:

The program to this question can be described as follows:

Program:

#include <stdio.h> //defining header file  

int main() //defining main method

{

int* numItemsPointer; //defining pointer variable

int numItems; //defining integer variable

scanf ("%d", &numItems); //input value from user end

if(numItems < 0) //defining if block to check value

{

   numItemsPointer = NULL; //assign value to null

   printf ("Items is negative\n"); //print message

}

else //else block

{

   numItemsPointer = &numItems; //holds address

   numItems = numItems * 10; //multiple by 10

   printf("Items: %d\n", *numItemsPointer); //print value

}

return 0;

}

Output:

99

Items: 990

Explanation:

In the above program two integer variable "numItemsPointer and numItems" is defined, in which numItemsPointer is a pointer variable and numItems is integer variable, in which we input value from the user end, and an if condition statement is used, that check and calculate the values, which can be described as follows:

  • In the if block a condition is defined that variable "numItems" is less then 0, if this condition is true so, inside the block, it will assign a value, that is equal to "NULL", and prints its value.
  • If the condition is not true it will go to the else block, in this block, it will first pointer variable holds the variable address, and multiply the value by 10, and prints pointer variable value.
7 0
3 years ago
Read 2 more answers
Which commonly used animation effect makes text on a slide appear in the presentation?
Mars2501 [29]
Powerpoint has a large number of animation effects, of which "Appear" is the simplest and most common one, followed by  "Fade". So I guess you're looking of one of these.
7 0
3 years ago
You're the network administrator for several Windows Server 2016 servers in New York. Your company just opened an office in Cali
vredina [299]

Answer:

The time zone on the California server needs to be changed.

Explanation:

A user seems to be the admin in Nyc over several servers running on the following Windows Server. His firm has just established a California branch, so transfer some of the servers to that of the new firm. Its server had been fully operational in less than 2 days of the user sending it. Now that the user has issues in authenticating between both the California server and the Nyc domain controllers.

So, the following issues are occurring in authenticating the servers of both places because the timezone of both places is different and they need to change the time zone on the California server.

5 0
3 years ago
Other questions:
  • A brick weighs 26 N. Measured underwater, it weighs 11 N.
    10·1 answer
  • PLEASE HELPP!! WILL MARK BRAINLIEST!!~~~~~
    11·1 answer
  • For your biology class, you have taken a number of measurements for A plant growth experiment. you wish to create a chart that s
    6·1 answer
  • What type of electronic monitoring involves an offender being contacted periodically by telephone or beeper to verify his or her
    5·1 answer
  • 9.10: Reverse ArrayWrite a function that accepts an int array and the array ’s size as arguments . The function should create a
    9·1 answer
  • How do you insert a new row into a worksheet
    5·1 answer
  • What date does GTA 6 come out<br> A. 2020<br> B. 2019<br> C. 2021<br> D. 2022
    10·2 answers
  • During project management, who executes tasks and produces the deliverables as stated in the project plan and as directed by the
    9·1 answer
  • A natural language processor comes across a sentence that contains the word “weightless.” The morphology component identifies th
    10·2 answers
  • when an overridden method is called from within a subclass, it will always refer to the version of that method defined by the (a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!