Question: There are 4 things wrong with this code (This assignment is written in C#). Please correct the code and explain what you did to correct
There are 4 things wrong with this code (This assignment is written in C#). Please correct the code and explain what you did to correct it:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace DebugFixMethods { class Program { static void Main(string[] args) { (new Program()).run(); }
void run() { int choice = 0;
WritePrompt(); choice = ReadChoice(); WriteChoice(choice);
}
void Writeprompt() { Console.WriteLine("Please select a course for which you want to register by typing the number inside []"); Console.WriteLine("[1]IT 145 [2]IT 200 [3]IT 201 [4]IT 270 [5]IT 315 [6]IT 328 [7]IT 330"); Console.Write("Enter your choice : "); }
int ReadChoice() { string s = ""; s = Console.ReadLine(); return (s); }
void WriteChoice(choice) { Console.WriteLine("Your choice is {0}", Choice); }
} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
