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
Louis wrote a check of $100 to the electricity company. After a few days he received a Notice of Dishonor from the bank regardin
diamong [38]

the checked bounced because he didn’t have any money.

mark me brainliest please!!!!!

4 0
3 years ago
In order to use SliIn order to use Slicers to filter some data, what must you first do to that data?cers to filter some data, wh
lakkis [162]

Answer:

<em />

<em>Splicers provide buttons that you can click to filter tables, or PivotTables. In addition to quick filtering, slicers also indicate the current filtering state, which makes it easy to understand what exactly is currently displayed animation</em>

<em />

8 0
3 years ago
What kind of computer system you recommend?
In-s [12.5K]
Depends on your budget and usage.
If no/low budget and happy with speed of current computer - replace network card or get an USB network card to resolve no wifi signal issue.
If no problem with budget - get a brand new latest computer.

Remember, it’s your data in the computer that worth a lot,computer hardware doesn’t cost that much and can be easily replaced.
7 0
3 years ago
Code in Python
KIM [24]

You're setting the value of user_num to 20. Doing this won't allow the other test cases to run. Simply delete that line and your code should work. This is the code I wrote:

user_num = int(input())

while user_num>=1:

   user_num/=2

   print(user_num)

I wrote my code in python 3.8. I hope this helps.

4 0
2 years ago
Enter just the letter of the correct answer
FromTheMoon [43]
The correct answer is firewall
7 0
3 years ago
Other questions:
  • Describe the difference between Global knowledge and personal idea. Why is it important to give credit to others by citing their
    6·1 answer
  • Write a program that asks the user to enter a birth year. the program should then indicate which generation a person of that yea
    14·1 answer
  • What part of the communication feedback loop results in unclear communication?
    13·1 answer
  • Which of the following statements is false? Question 4 options: By convention class names begin with an uppercase letter, and me
    8·2 answers
  • 9.1.3: Printing vector elements with a for loop. Write a for loop to print all NUM_VALS elements of vector courseGrades, followi
    5·1 answer
  • Given the scenario, before leaving the office, you ask the CIO to provide which formal document authorizing you to perform certa
    11·1 answer
  • write a java program that prompts the user to enter scores (each number an integer from 0 to 10) and prints the following output
    13·1 answer
  • How is scale depicted on a flat video screen?
    13·1 answer
  • A type of user interface that features on- screen objects, such a menus and icons, manipulated by a mouse.
    7·1 answer
  • Should a UDP packet header contain both Sour Port # and Destination Port #?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!