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
ehidna [41]
3 years ago
8

Write an application named SumInts that allows the user to enter any number of integers continuously until the user enters 999.

Display the sum of the values entered, not including 999.
Computers and Technology
1 answer:
Nana76 [90]3 years ago
4 0

Answer:

import java.util.Scanner;

public class num10 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter the numbers to add up. enter 999 to stop");

       int num = in.nextInt();

       int sum = 0;

       while (num!=999){

           sum = sum+num;

           System.out.println("Enter the next number");

           num = in.nextInt();

       }

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

   }

}

Explanation:

The application is implemented in Java

A while loop is used to continously prompt user for inputs. The condition of the while loop is  while (num!=999)

When the number 999 is entered, it displays the sum which is initialized to 0

You might be interested in
An attribute whose value uniquely identifies an object is called a(n) _______.​
Juliette [100K]
This is called a key attribute!

There are different types of key attributes!

Primary key is the key that is actually chosen, for example a social security number. 

There is also a unique key, say our finger prints! they also uniquely identify humans, but usually we prefer to use social security number when we list people (a unique key could be a primary key if we chose so)

We could also identify people by their social security number and a name, but this is unnecessary, as social security number already gives a full identification. Such a reduntant key is called super key. 
6 0
3 years ago
How to understand amortized analysis potential?
MA_775_DIABLO [31]
Since you gave kind of a vague question. I'll just go with the basics. Amortized analysis in computer science is basically the study of worst case run times regarding a sequence of operations.

When looking at potential, it is the physicist's method.
phi (initial state) =0 and every state after is larger than 0.
It keeps track of time but relies on states to know where it is.

The equation C +phi (state')-phi(state) is the main equation. C is the time for an operation, "state" is before and "state'" is after.

There are sets of equations that dictate average run time with this.

ex.
phi (H)= 2n-m. n=number of elements, m=size of array.
This equation is used to calculate the time to double the size.
4 0
3 years ago
what will happen to the contents of the destination ell if you copy the contents of the source cell into the destination cell
DochEvi [55]

Answer:

It's content will be replaced with a content from the source cell.

7 0
3 years ago
When writing test methods, what functionality is verified by the system method "runAs()"?
olchik [2.2K]

Answer:

The main functionality verified by this test method command is user sharing record.

Explanation:

Generally, every apex code runs in system mode.

Apex is strong object-oriented programming language that allows the developers to execute flow and transaction control.

Using syntax which look like java and acts as databases, Apex allows the developer to add any type of business logics to an event which can include button, clicks records or visual pages.

Apex code can be initiated by web service request.  

The permissions and record sharing of current user are not consider by apex codes.

Now the system method runAs() will allow you to take or write a test method which will basically change the user context to an existing or an new user, so that the record sharing will take place.

runAs() command will not change or anything done with user permissions or permission levels, it will only record sharing of the user.  

When you use runAs() command the original and true context will run after the test method is once completed under the command of runAs().

The runAs() has no concern with the user license.  

If there is no or expired your personal or organization license you can just make a new user with this runAS() command.

In using this command we have to make a private class by the name of this test and then our further code to make a user , afterwards  which we will the true and original code of ours which we want to run.

There are many other uses of runAs() like  

 Mixed DML operations in test by opening the DML operations.

 We can also use it as a version which will take a package as a version argument. This will cause the code a specific version.

runAs(System.Version) is the command used for this.

4 0
3 years ago
Atheel tests a program and gets a NameError. How can this be fixed?
Oksana_A [137]

Answer:

You can't call a function unless you've already defined it. Move the def createDirs(): block up to the top of your file, below the imports.

Explanation:

Some languages allow you to use functions before defining them. For example, javascript calls this "hoisting". But Python is not one of those languages.

7 0
3 years ago
Read 2 more answers
Other questions:
  • As you are researching RAM for a computer you are building that will be used as a home office server for his small business. The
    5·2 answers
  • Please use Python 3 to solve the following problem. Please also show all outputs and share code.The variable sentence stores a s
    6·1 answer
  • You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to
    9·2 answers
  • Please helpp!! I need it quickly!
    6·1 answer
  • What are the different ways to represent compounds? Check all that apply. a structural formula a ball model a space-filling mode
    13·2 answers
  • 9
    10·1 answer
  • Which list shows a correct order of mathematical operations that would be used by a spreadsheet formula?
    5·2 answers
  • Plsss help me plsssssss
    11·1 answer
  • Jiz<br>Active<br>2<br>3<br>- 2(7 - 15)<br>What is the value of<br>4​
    10·2 answers
  • There are a wide variety of nonsampling errors that can occur during data collection including the first type, ________.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!