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
spin [16.1K]
3 years ago
5

Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou

ld ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate
Sample Run1

Enter two numbers: 3 15

Do you want another operation: Yes

Enter two numbers: 45 56

Do you want another operation: No

Output1: Sum = 119

Sample Run2

Enter two numbers: 33 150

Do you want another operation: Yes

Enter two numbers: -56 56

Do you want another operation: Yes

Enter two numbers: 58 15

Do you want another operation: Yes

Enter two numbers: 123 87

Do you want another operation: No

Output2: Sum = 466
Computers and Technology
1 answer:
Gala2k [10]3 years ago
6 0

Answer:

import java.util.Scanner;

public class TestClock {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int sum = 0;

       char op;

       do{

           System.out.println("Enter two numbers");

           int num1= in.nextInt();

           int num2 = in.nextInt();

           sum = sum+num1+num2;

           System.out.println("Do you wish to perform another operation, Y/N");

           op =in.next().charAt(0);

       }while(op =='Y'||op=='y');

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

   }

}

Explanation:

The code is implemented in Java progrmming language

  1. create an integer variable sum
  2. create a character variable op
  3. create a do while loop to request user to enter num1 and num2
  4. Request the user to also enter a char Y/N (yes or no repectively)
  5. While the char is Y keep adding up the sum and prompt the user to enter two new numbers
  6. Else break out of the loop and print the sum
You might be interested in
In which type of attack do you get malicious code in links from seemingly reliable websites?
natali 33 [55]

I think it is C. cross-site scripting

6 0
3 years ago
Anyone wanna join my giggl?
Leni [432]

Answer:

whats a giggl

Explanation:

7 0
3 years ago
Read 2 more answers
Which type of software is used for marketing research as a way to find out about users' preferences?
kogti [31]

Answer:

Adware

Explanation:

It's software that displays advertisements to users and gauges their preferences

8 0
3 years ago
Computer-based networks that trigger actions by sensing changes in the real or digital world are known as: global marketing plat
Gennadij [26K]
It known as the smart systems

It make decision by describing and analyzing the available data in a predictive or adaptive manner thereby performing an efficient and smart actions based on that analysis

A lot of smart systems evolved from micro systems
8 0
3 years ago
What is a primary risk to the Workstation Domain, the Local Area Network (LAN) Domain, and the System/Application Domain
eimsori [14]

It should be noted that a primary risk to the Workstation Domain is the absence of a firewall and unauthorized access to the workstation.

<h3>What is a workstation domain?</h3>

The Workstation Domain simply means an individual user's computer where his or her work takes place. It should be noted that computers operating systems have vulnerability which can be susceptible to hackers.

A primary risk to the Workstation Domain is the absence of a firewall and unauthorized access to the workstation.

Learn more about workstation on:

brainly.com/question/26097779

8 0
3 years ago
Other questions:
  • It is either snoming or below freezing
    10·1 answer
  • To copy the formatting of one control to other controls, use the ____ button on the form design tools format tab.
    7·1 answer
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • Servlet session and JSP session have different abilities.TrueFalse
    9·1 answer
  • Enterprise Resource Planning (ERP) is an example of a single user database.
    7·1 answer
  • list = 7 # these many modified Fibonacci numbers. def fibonacci_gt(n, t1, t2): if n&lt;0: print("Incorrect input") elif n == 0:
    12·1 answer
  • To enter new code that performs as intended in the place of the old code that produces an error is the goal of
    9·1 answer
  • Taking a group of recipes and identifying the similarities is an example of _____.
    13·1 answer
  • What is the best food to eat before workout? why?​
    10·2 answers
  • Zoe wants to use an image file that will allow her to preserve all of the original
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!