subject
Computers and Technology, 09.02.2021 23:50 nez45

INSTRUCTIONS 1. Pind & fix the syntax error so program will compile
2. Run program entering different whole number inputs to discover the logic error
3. Modify program so that it works correctly
4. Run the program entering decimal input to cause a runtime error (InputMismatchException)
5. Modify program so it won't crash with decimal input
import java. util. Scanner;
public class Temperature
public static void main(String[] args)
{
1/Variable declaration
double temp = 0;
//Instantiating a Scanner object to get user input
Scanner sc = new Scanner(System. in);
//Get temperature from user
System. out. print("Enter a temperature: ");
temp - sc. nextInt();
//Display message based on temperature
if (temp <= 32)
System. out. println("It's freezing.");
if (temp < 50)
System. out. println("It's cold.");
if (temp < 80)
System. out. println("It's warm.");
if (temp < 100);
System. out. println("It's hot.");
else
System. out. println("It's extremely hot!");
> //end main
}//end class

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, Melissamv2052
Selective incapacitation is a strategy to reduce prison population
Answers: 3
image
Computers and Technology, 22.06.2019 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, caromaybelline71
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
image
Computers and Technology, 24.06.2019 15:50, GreatBaconGamer
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
You know the right answer?
INSTRUCTIONS 1. Pind & fix the syntax error so program will compile
2. Run program enteri...

Questions in other subjects:

Konu
Mathematics, 08.09.2020 08:01
Konu
English, 08.09.2020 08:01