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
Gekata [30.6K]
3 years ago
6

Develop a menu-driven program that inputs two numbers and, at the user’s option, finds their sum, difference, product, or quotie

nt.
Computers and Technology
1 answer:
Reptile [31]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);

       System.out.println("Enter num 1");

       double num1 = in.nextDouble();

       System.out.println("Enter num 2");

       double num2 = in.nextDouble();

       System.out.println("enter \"s\" for addition\t \"d\" for difference\t \"p\" for the product\t and \"q\" for the quotient");

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

       if(op =='s'||op=='S'){

           double sum = num1+num2;

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

       }

       else   if(op =='d'||op=='D'){

           double diff = num1-num2;

           System.out.println("The difference is "+diff);

       }

       else if(op =='p'||op=='P'){

           double prod = num1*num2;

           System.out.println("The product is "+prod);

       }

       else if(op =='q'||op=='Q'){

           double quo = num1/num2;

           System.out.println("The Quotient is "+quo);

       }

   }

}

Explanation:

  1. Use Scanner class to receive the two numbers and save in a two variables
  2. Create a new variable for Operation (op) to store a character
  3. Request the user to enter a character for the opearation (e.g s=sum, p=product, q=quotient and d=difference)
  4. Use if/else..if statements to implement the required operation

You might be interested in
How do you modify WordArt? Give specific details and steps<br><br> NEED THIS ASAP
masha68 [24]

The steps to modify a WordArt text are:

  • Click on the Editing WordArt Text
  • Then Double click or select  the WordArt image.
  • Via the use of the Format command tab, in the Text group, select Edit Text and the Edit WordArt Text dialog box show
  • Through the use of the Text text box, make all changes you want.
  • Select OK.

<h3>What is Word art?</h3>

Word art or text art is known to be a kind of an art that is made up of text, creating words or phrases along with  visual imagery.

Therefore, The steps to modify a WordArt text are:

Click on the Editing WordArt TextThen Double click or select  the WordArt image.Via the use of the Format command tab, in the Text group, select Edit Text and the Edit WordArt Text dialog box showThrough the use of the Text text box, make all changes you want.

Select OK.

Learn more about WordArt from

brainly.com/question/938171

#SPJ1

7 0
2 years ago
While recording a voice, if the narration is large,it is better to make a :a)a linked object b)an embedded object c)none d)does
goldenfox [79]

Answer:

c)none

Explanation:

Automatic updates can be a great problem in the case of the linked object and an embedded object. Hence, "a" and "b" are not the correct options, and since there is an effect, the d. the option is also not correct, as it does affect. And hence none of these options are correct. And the correct option is c) none.

4 0
3 years ago
The information provided in text aids can help us to understand a text’s content before we even read it.
dimaraw [331]
It is true that the information provided in text aids can help us to understand a text's content before we even read it.
These text aids will contain bits and pieces from the text, which will make us understand the overall message even before we actually get down to going through the text itself. I believe it is better to actually read the text, and try to understand it on your own, before going to these aids for help.
7 0
4 years ago
HURRY IM TIMED Note that common skills are listed toward the top, and less common skills are listed toward the bottom. According
Sloan [31]

Answer:

1 and 3 are the answers

4 0
3 years ago
Read 2 more answers
What is this computer​
Salsk061 [2.6K]

Answer:

A Macintosh

Explanation:

6 0
3 years ago
Other questions:
  • Store shelves are empty during periods of Excess Demand. What is another term for Excess Demand?
    8·1 answer
  • The code that follows saves the data that was in the $names array as
    13·1 answer
  • The Top status bar command is used to display the highest value in the selected range in the AutoCalculate area. (True/False)
    7·1 answer
  • You have decided you want to remove a software application from your computer. what is the first place you should go to do so?
    15·1 answer
  • to create a cover letter to send to a potential employers along with a resume what software program should you use
    10·1 answer
  • Suppose the work required to stretch a spring from 1.1m beyond its natural length to a meters beyond its natural length is 5 J,
    14·1 answer
  • The action displayed in the status bar while pointing-
    7·1 answer
  • Write any two rules for writing algorithm​
    10·1 answer
  • List 90 examples of word
    12·1 answer
  • Which of the following numbers is of type
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!