
THE PIECE OF CODING THAT I HAVE HIGHLIGHTED BELOW KEEPS SHOWING ERRORS, WHY? CAN YOU FIX IT
class
{
public void Menu() //Menu function to print menu
{
Console.WriteLine("Enter P-to print menu\nEnter C-to convert from Celsius c.\nEnter F-to convert from Fahrenheit"); //printing the menu
}
public void CelsiusToFahrenheit() //function to convert celcius to fahrenheit
{
int cel;
double toFah;
Console.WriteLine("Enter a number to convert from celsius to Fahrenheit");
cel = Convert.ToInt32(Console.ReadLine());
toFah = (double)cel * 9 / 5 + 32; //converting to fahrenheit
Console.WriteLine("After converting to Fahrenheit = " + toFah);//printing the fahrenheit value
}
public void FahrenheitToCelsius()//this is the function to convert fahrenheit to celsius
{
int fah;//the variable to store fahrenheit value
double toCel;
Console.WriteLine("Enter a number to convert from Fahrenheit to celsius");
fah = Convert.ToInt32(Console.ReadLine());//taking fahrenheit input from user
toCel = (double)(fah - 32) * 5 / 9;//converting to fahrenhiet
Console.WriteLine("After converting to Celsius = " + toCel);
}
public static void Main(string[] args)
{
Temperature tp = new Temperature();
char ch;
int cel;
int fah;
double toCel;
double toFah;
Console.WriteLine("Enter P-to print menu\nEnter C-to convert from Celsius c.\nEnter F-to convert from Fahrenheit");
ch = Console.ReadLine()[0];
if (ch == 'P')
{
tp.Menu();
}
else if (ch == 'C')
{
tp.CelsiusToFahrenheit();
}
else if (ch == 'F')
{
tp.FahrenheitToCelsius();
}
}
}

Step by stepSolved in 2 steps

- public static char start(char key) {Scanner console = new Scanner(System.in);String prompt = "Enter 'q' to quit. Any other key to continue...";double height;double weight;System.out.println("Enter something before you start : >>>>");while (key != 'q'){height = getHeight(console);weight = getWeight(console);displaySummary(height, weight);//prompt to quitSystem.out.println();System.out.print(prompt);key = console.next().charAt(0);}return key;} How can I test this one in the J-unit test?? Is it testable?arrow_forwardshow: Lists the items that the wizard is currently carrying along with the index for each item and the weight of that item. See sample runs below. As shown in the sample this function also prints the total weight of the items along with the max weight limit of 100 lbs. Hint: You can use the sum function in Python to calculate the sum of weights. E.g. sum(weights) will return the sum of all the items in the weights list. grab_item: Add a new item while enforcing the following policy: There is a limit of 4 on the number of items the wizard can carry and limit of 100 lbs on the total weight the wizard can carry. So specifically, if the wizard is already carrying 4 items, print message that “You can't carry anymore items. Drop something first.” And return out of the function. Otherwise prompt the user for the name and the weight of the new item. Next check whether with the addition of the new item, the total weight will exceed the limit of 100 lbs. If so, print a message saying weight…arrow_forwardPROBLEM STATEMENT: Return the String "odd" if the input is odd otherwisereturn "even". public class CheckForEven{public static String solution(int number){// ↓↓↓↓ your code goes here ↓↓↓↓return null;}} please get help with this Java Questionarrow_forward
- Thanks you so much! Another questions: this is my code (see image), and I was trying to let the turtle to draw 4 different sizes sqaures, but after I ran my code, the turtle drew out 4 same size squares, where or how should I fix it(or update it)? thank you.arrow_forwardHELP WITH JAVA PLEASE PROVIDE INDENTED CODES SO I CAN COPY N PASTE MAKE SURE UR OUTPUT COMPILES FINE AND IN A GUI PANEL. TAKE A SCREENSHOT OF OUR OUTPUT AND PASTE HERE AS WELL ALSO, For project 2 you need to create a class for the list nodes, RomanNumeralListNode DO THE FOLLOWING:arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





