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
When working in outline mode, press __________ and click the eye icon to change only one layer back to preview mode.
Natasha2012 [34]

Answer:

Butt

Explanation:

erflies

4 0
2 years ago
A digital media professional's computer is too full of video files. She would like to upgrade her computer to have more capacity
defon
To buy a external hard drive
4 0
3 years ago
Read 2 more answers
Once you resize a photograph, it cannot be returned to its original size. TRUE or FALSE
VladimirAG [237]
I believe the answer is false

8 0
2 years ago
The spreadsheet below shows the age, grade level, major, and minor of four students in college. A purple background in the Major
LiRa [457]

Answer:

apply a filter by age with a value more than 20

Explanation:

First, we must create the spreadsheet with the fields student, age, grade level, major and minor.

For example:

If we want to create a filter, we must mark headings with the left click, then we must go to the tab Home --> at the section Editing, click in Sort & filter then Filter.

We must click in the field Age --> number filters --> greater than 20.

8 0
3 years ago
Whats the next lyric,i baked you a pie,pie,pie
eduard
“oh boy what flavor”
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which folder is the default choice for saving bitmap or JPEG files created by a user?
    9·1 answer
  • Which is faster, a hi-speed usb port or a superspeed usb port?
    15·2 answers
  • PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    11·2 answers
  • How many bytes of information can be stored on a hard drive?
    7·1 answer
  • Describe the photograph that David begins discussing what is the contacts for the photograph
    7·1 answer
  • Use HTML to create a web page
    10·1 answer
  • Use fuel with the _____________ rating recommended by your vehicle manufacturer. A ) Converter B) Emission C) Exhaust D) Octane
    9·2 answers
  • Bryan's company is new and has limited funds to work with. He has been tasked with finding a telecommunications technology that
    7·1 answer
  • Question #1 Mutiple Select Which features are important when you plan a program? Select 4 options. Knowing what you want the pro
    5·1 answer
  • A user generates printouts consisting of several pages of seemingly random characters every time he prints to a network printer.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!