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
allochka39001 [22]
3 years ago
13

Write a program that allows the user to convert a temperature given in degrees from either Celsius to Fahrenheit or Fahrenheit t

o Celsius. Use the following formulas: Degrees_C = 5(Degrees_F− 32)/9 and Degrees_F = (9(Degrees_C)/5) + 32) Prompt the user to enter a temperature and either a C or c for Celsius or an F or f for Fahrenheit. Convert the temperature to Fahrenheit if Celsius is entered, or to Celsius if Fahrenheit is entered. Display the result in a readable format. If anything other than C, c, F, or f is entered, print an error message and stop.
Computers and Technology
1 answer:
lutik1710 [3]3 years ago
7 0

Answer:

import java.util.Scanner;

public class num6 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter the temperature");

       double temp = in.nextDouble();

       System.out.println("Enter C to convert to celsius or F for fahrenheit");

       String con = in.next();

       if (con.equalsIgnoreCase("C")) {

           double Degrees_C = 5 * (temp - 32) / 9;

           System.out.println("The temperature of " + temp + "F in Celcius is" +

                   " " + Degrees_C);

       } else if (con.equalsIgnoreCase("F")) {

           //Degrees_F = (9(Degrees_C)/5) + 32)

           double Degrees_F = (9 * (temp) / 5) + 32;

           System.out.println("The temperature of " + temp + " celcius in Farenheit is" +

                   " " + Degrees_F);

       } else {

           System.out.println("Invalid value for conversion");

       }

   }

}

Explanation:

Use Scanner Class to prompt and receive user input

Use string method equalsIgnoreCase in an if statement to test the conversion to degrees celcius or farenheit

evaluate and output the values based on the equation given in the question

You might be interested in
Write a Python class that inputs a polynomial in standard algebraic notation and outputs the first derivative of that polynomial
Ivahew [28]

Answer:Python code: This will work for equations that have "+" symbol .If you want to change the code to work for "-" also then change the code accordingly. import re def readEquation(eq): terms = eq.s

Explanation:

3 0
2 years ago
Which MUD configuration is the most difficult to maintain
mihalych1998 [28]
This may be considered particularly appropriate since, due to the room-based nature of traditionalMUDs<span>, ranged combat is typically </span>difficult<span> to implement, resulting in </span>most MUDs<span> equipping characters mainly with close-combat weapons.</span>
6 0
2 years ago
Read 2 more answers
3.1.2 Quiz: What Can Information Technology Do for You? Question 8 of 10 What is one reason why a business may want to move enti
balu736 [363]

Answer:

C. To focus on a global market

Explanation:

Information technology can be defined as a set of components or computer systems, which is used to collect, store, and process data, as well as dissemination of information, knowledge, and distribution of digital products.

An information technology interacts with its environment by receiving data in its raw forms and information in a usable format.

Generally, it is an integral part of human life because individuals, organizations, and institutions rely on information technology and systems in order to perform their duties, functions or tasks and to manage their operations effectively. For example, all organizations make use of information technology and systems for supply chain management, process financial accounts, manage their workforce, and as a marketing channels to reach their customers or potential customers.

Additionally, an information system or technology comprises of five (5) main components;

1. Hardware.

2. Software.

3. Database.

4. Human resources.

5. Telecommunications.

Hence, information technology or system relies on the data it receives from its environment, processes this data into formats that are usable by the end users.

One reason why a business may want to move entirely online is to focus on a global market through the use of social media platforms and networks to reach out to customers in various geographical location.

5 0
3 years ago
What is the term for the instructions that tell a computer what to do
Liono4ka [1.6K]

Answer: I believe it's software.

4 0
3 years ago
Which loan type requires you to make loan payments while you’re attending school?
Levart [38]
<span>A:Unsubsidized federal loan</span>
7 0
3 years ago
Other questions:
  • Which feature of Microsoft power point allowed you to put a picture in every slide
    8·1 answer
  • Hi <br> What exactly does this project want from me?thanks for riding
    5·1 answer
  • What process improves the life of a computer
    11·1 answer
  • A ___________ is the smallest unit in a written language.
    7·2 answers
  • Which of the following explains the growing need for a standard IT professional licensing program? Check all of the boxes that a
    11·1 answer
  • What is an instruction set architecture​
    7·2 answers
  • In order to install a device, the operating system needs the required __________ for that device.
    13·2 answers
  • Construct sequence using a specified number of integers within a range. The sequence must be strictly increasing at first and th
    6·1 answer
  • Help brainleist giving exam
    15·1 answer
  • write the files used on QBASIC (If u will answer right answer I will follow U and U will got 40 points)​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!