Hello! Can you help debug my Java program? I'm writing a program to convert Celsius to Farenheit. Attached is a screenshot of my code, and here are the errors I'm getting. Line 17: Cannot make a...


Hello! Can you help debug my Java program? I'm writing a program to convert Celsius to Farenheit. Attached is a screenshot of my code, and here are the errors I'm getting.



Line 17: Cannot make a static reference to the non-static method nextDouble() from the type Scanner
Line 26: Syntax error on token “:”, -> expected
Line 30: Syntax error on token “Average: Fahrenheit””, delete this token
Line 26: Syntax error on token ), ( expected
Line 32: Syntax error on token /, ( expected
Line 26: Syntax error on token %, delete this token
Line 30: Syntax error on token %, delete this token (x3)
Line 18: Syntax error on token “if”, ( expected after this token
Line 6: Syntax error on token “Scanner”< variabledeclaratorld="" expected="" after="" this="">
Line 26: Syntax error on token(s), misplaced construct(s)
Line 18: Syntax error, insert “) Statement” to complete IfStatement
Line 26: Syntax error, insert ) to complete Expression
Line 32: Syntax error, insert ) to complete expression
Line 26: Syntax error, insert ) to complete MethodInvocation


1 package temperatureConversion;<br>2<br>3 import java.util.Scanner;<br>5 public class TemperatureConversion {<br>O 60<br>public static Scanner = new Scanner(System.in);<br>public static void main(String [largs) {<br>double totalCelsius = 0;<br>double totalFarenheit = 0;<br>int count = 0;<br>8.<br>10<br>11<br>12<br>= 0, farenheit = 0;<br>13<br>14<br>15<br>16<br>double temperature<br>while (true) {<br>System.out.println(

Extracted text: 1 package temperatureConversion; 2 3 import java.util.Scanner; 5 public class TemperatureConversion { O 60 public static Scanner = new Scanner(System.in); public static void main(String [largs) { double totalCelsius = 0; double totalFarenheit = 0; int count = 0; 8. 10 11 12 = 0, farenheit = 0; 13 14 15 16 double temperature while (true) { System.out.println("Centigrade is another name for Celsius"); System.out.print("Enter a temperature in Centigrade or <= -100="" to="" quit.");;="" temperature="" if="" temperature=""><= -100 { break; scanner.nextdouble(); 17 018 19 20 21 farenheit = tofarenheit(temperature); totalfarenheit += farenheit; totalcelsius += temperature; count += 1; system.out.println(string.format (temperature: e(%2f) (c%2f); farenheit. temperature)); 22 23 24 25 o26 27 28 29 030 system.out.printf("average: centigrade" + ($2f) "average:. farenheit". + (%2f)); 31 032 totalcelsius/count, totalfarenheit/count; 33 34 35 36 public static double tofarenheit (double temperature) { return temperature * 9/5 +32; 370 38 39 40 41 42 } 43 임응 0 -100="" {="" break;="" scanner.nextdouble();="" 17="" 018="" 19="" 20="" 21="" farenheit="toFarenheit(temperature);" totalfarenheit="" +="farenheit;" totalcelsius="" +="temperature;" count="" +="1;" system.out.println(string.format="" (temperature:="" e(%2f)="" (c%2f);="" farenheit.="" temperature));="" 22="" 23="" 24="" 25="" o26="" 27="" 28="" 29="" 030="" system.out.printf("average:="" centigrade"="" +="" ($2f)="" "average:.="" farenheit".="" +="" (%2f));="" 31="" 032="" totalcelsius/count,="" totalfarenheit/count;="" 33="" 34="" 35="" 36="" public="" static="" double="" tofarenheit="" (double="" temperature)="" {="" return="" temperature="" *="" 9/5="" +32;="" 370="" 38="" 39="" 40="" 41="" 42="" }="" 43="" 임응="">
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here