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.
// 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started