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
dalvyx [7]
4 years ago
11

Write a program the will convert Celsius to Fahrenheit or the other way.The user is asked to enter a floating point number.The u

ser should be asked to select the conversation that will be performed.The menu should look like the following:
C-----From Celsius to Fahrenheit
F-----From Fahrenheit to Celsius
Computers and Technology
1 answer:
meriva4 years ago
8 0

Answer:

<u>Output</u>

Temperature Converter

C-----From Celsius to Fahrenheit

F-----From Fahrenheit to Celsius

Enter your choice (C or F):  

C

Enter temperature in Celsius:  

45

Temperature in Fahrenheit: 113.0 °F

Explanation:

Below given is a java code that will convert Celsius to Fahrenheit or the other way:-

import java.util.Scanner;

public class TemperatureConvertor {

public static void main(String[] args){

 double celsius=0.0;

 double fahrenheit=0.0;

 String choice;

 Scanner input=new Scanner(System.in);

 System.out.println("Temperature Convertor");

 System.out.println("C-----From Celsius to Fahrenheit");

 System.out.println("F-----From Fahrenheit to Celsius");

 System.out.println("Enter your choice (C or F): ");

 choice=input.next();

 if(choice.equals("C")){

  System.out.println("Enter temperature in Celsius: ");

  celsius=input.nextDouble();

  fahrenheit=((9*celsius)/5)+32;

  System.out.println("Temperature in Fahrenheit: "+fahrenheit+" °F");

 }else if(choice.equals("F")){

  System.out.println("Enter temperature in Fahrenheit: ");

  fahrenheit=input.nextDouble();

  celsius=(5*(fahrenheit-32))/9;

  System.out.println("Temperature in Celcius: "+celsius+" °C");

 }else{

  System.out.println("Wrong choice !!!");

 }

 

}

}

You might be interested in
To change the backround color of a page, which tab would you use?
ivann1987 [24]
I have concluded the answer is a
4 0
4 years ago
Read 2 more answers
Match each of the following terms to its function:_________
Crazy boy [7]

Answer:

I = B

II = E

III = A

IV = D

V = C

7 0
4 years ago
Selecting the Tiled windows arrangement option places the windows in a(n) _______ pattern on the screen.
Archy [21]

Answer:

Selecting the Tiled windows arrangement option places the windows in a(n) Grid pattern on the screen.

Explanation:

3 0
2 years ago
Alma will make the honor roll if she has at least a 3.80 GPA and misses less than 5 days of school in a year. In which of the fo
Whitepunk [10]

Answer: 4. Alma has a 3.81 GPA and misses 3 days of school

Explanation: The others don't meet the requirments.

8 0
3 years ago
How is Boolean logic used in logic gates? Select three options.
tresset_1 [31]

Answer: It would be the last three

Explanation: just did it on edge and got 100%

8 0
3 years ago
Other questions:
  • What is the equivalent of film speed in digital cameras?
    6·2 answers
  • Is a fundamental building block of a relational database because this object stores all of the data
    15·1 answer
  • Write a program in java that reads each line in a file, reverses its characters, and writes the resulting line to another file
    15·1 answer
  • The number of bits that can be transferred per second over a given transmission medium.
    6·1 answer
  • What is the best brand of folders
    13·2 answers
  • Simplify the Boolean expression AB+(AC)`+AB`C(AB+C)
    13·1 answer
  • PlZZZZZZZ help will give Brainliest
    8·2 answers
  • A human subject’s photographs show two catchlights in each eye that are unwanted by the photographer. What is the most likely ca
    12·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    6·1 answer
  • Task 5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is sto
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!