Question: In C#, determine the syntax and or logical problems in the codetyped below the image. Please post the corrected code in your solution. Thank you.

In C#, determine the syntax and or logical problems in the codetyped below the image.

Please post the corrected code in your solution. Thank you.

Debugging Exercise 2-4 Instructions Y The program DebugTwo4.cs has syntax and/or logical

// This program tells the user the values of the integers thatare
// one more and one less than the entered integer
using System;
using static System.Console;
classDebugTwo4
{
static void Main()
{
string entry;
int enteredInteger;
int more, less;
Write("Enter an integer >>");
entry = ReadLine();
WriteLine("You entered {0}",entry);
enterdInteger =Convert.ToInt32(entry);
more = enteredInteger + 1;
less = enteredInteger - 1;
WriteLine("One more than (0) is {1}and one less than {2} is {3}",
enteredInteger, more less);
}
}

Debugging Exercise 2-4 Instructions Y The program DebugTwo4.cs has syntax and/or logical errors. Determine the problem(s) and fix the program. Grading 7 DebugTwo4.cs + 1 // This program tells the user the values of the integers that are 2 // one more and one less than the entered integer 3 using System; 4 using static System.Console; 5 classDebugTwo4 6 { static void Main() 8 When you have completed your program, click the Submit button to record your score. { 9 string entry; 10 int entered Integer; 11 int more, less; 12 13 14 15 16 more 17 less 18 19 Write("Enter an integer >> "); entry ReadLine(); WriteLine("You entered {0}", entry); enterdInteger = Convert.ToInt32(entry); enteredInteger + 1; enteredInteger 1; WriteLine("One more than (0) is {1} and one less than {2} is {3}", enteredInteger, more less); 20 } 21 } 22

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!