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
Stells [14]
3 years ago
15

Java

Computers and Technology
1 answer:
inna [77]3 years ago
3 0

Answer:

import java.util.Scanner;

public class num3 {

   public static void main(String[] args) {

     Scanner in = new Scanner(System.in);

       System.out.print("Enter two numbers: ");

       int num1 = in.nextInt();

       int num2 = in.nextInt();

       int sum = num1+num2;

       System.out.print("Do you want another operation: ");

       String ans = in.next();

       while(ans.equalsIgnoreCase("yes")){

           System.out.print("Enter two numbers:");

           num1= in.nextInt();

           num2 = in.nextInt();

           System.out.println("Do you want another operation: ");

           ans = in.next();

           sum = sum+(num1+num2);

       }

       System.out.println("sum = "+sum);

   }

}

Explanation:

In the program written in Java Programming language,

The scanner class is used to prompt and receive two numbers from the user which are stored as num1 and num2. Another variable sum is created to hold the sum of this numbers

Then the user is prompted to answer yes or no using Java's equal.IgnoreCase() method.

If the user enters yes, he/she is allowed to entered two more numbers that are countinually added to sum

If the user eventually enters a string that is not equal to yes. The loop terminates and the accumulated value of sum is printed.

You might be interested in
________ are devices used to send data between two networks.
svetoff [14.1K]
The answer is routers
4 0
3 years ago
What do you call the quality of information
Kobotan [32]

Answer:

"Information quality" is a measure of the value which the information provides to the user of that information. accuracy, objectivity, Believability, reputation.

Explanation:

8 0
3 years ago
Which command would you use to move a file from one location to another?
Ksivusya [100]
On Windows, if you use CMD, there is a command called 'move' and using a Linux terminal, it's 'mv'
7 0
3 years ago
Read 2 more answers
You browsing internet and you realize that its not responding what do you do with out rebooting the computer
Allisa [31]
You can try and turn wifi off then on press save on whatever you were doing if you can then reboot it. other then that theres not many more options.
4 0
4 years ago
True false) ther are five arrow keys on the keborad​
cluponka [151]

Answer:

false, there's only 4

Explanation:

5 0
3 years ago
Other questions:
  • Which of the following is an example of a good listening skill? A. Replying to the caller as "you" rather than using his or her
    9·2 answers
  • Tiffany is an instructor at a college that is run on student tuition and not state taxes. Which statement best describes her emp
    6·2 answers
  • 4+4 act quick for brainliest
    10·2 answers
  • Can someone help me to give this guy brainliest the button is not there
    8·1 answer
  • Peter has a website that promotes his local vacation rental site. He uses Google Ads to manage his advertising campaign. He’s cr
    13·1 answer
  • If a speed mismatch was configured between two Cisco routers' Ethernet interfaces, what would the status of this interface be?
    12·1 answer
  • Henry went to an IT software company for an interview he was offered a position in lower level management which positions could
    11·1 answer
  • When working on developing an ability, it is important to get feedback to know how you are doing.
    6·1 answer
  • The most important task in developing a new computer system/app is to: a) choose the most current technologies such as operating
    5·1 answer
  • What does the "zoom tool" do in Photoshop?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!