Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question: FIX THE ERRORS , BUT ONLY USING C#, PLEASE there are 3 separate and di

ID: 3588129 • Letter: Q

Question

Question: FIX THE ERRORS , BUT ONLY USING C#, PLEASE there are 3 separate and differen codes please dont mi...

FIX THE ERRORS , BUT ONLY USING C# ONLY, PLEASE

there are 3 separate and differen codes please dont mix them

a)

// Overloaded method gives bonus points
// whether grade is a number or letter
using static System.console;
class DebugEight2
{
Static Void Main()
{
int numericScore = 0;
Do
{
Try
{
Write("What is the score? ");
numericScore = Convert.ToInt32(ReadLine());
}
Catch
{
Write("Bad format for score. Try again. What is the score? ")
}
}
While(bad)

string letterScore = "";
Write("What is the score's letter grade? ?);
letterScore = ReadLine();

Write("Score was {0}. ", numericScore);
GiveBonus(ref numericScore);
WriteLine("Now it is {0}.", numericScore);
Write("Grade was ", letterScore);
GiveBonus(ref letterScore);
WriteLine("Now it is ", letterScore);
}
private static void GiveBonus(int ref testScore)
{
const int BONUS = 5;
testScore = BONUS;
}
private static void GiveBonus(string ref letterScore)
{
const string BONUS = "+";
letterScore = BONUS;
}
}

b)

// Creates a HomeworkAssignment class
// instantiates two objects
// and prompts the user for infromation about two courses
using static System,Console;
class DebugNine1
{
static void Main()
{
HomeworkAssignment course1 = new HomeworkAssignment();
HomeworkAssignment course2 = new HomeworkAssignment();
String entryString;
Int exercises;

// Get info for first class
Write("What class do you have homework for? ");
entry = ReadLine();
course1.className = entryString;
Write("How many exercises must you complete? ");
entryString = ReadLine();
int.TryParse(entryString, exercises);
exercises = course1.NumberOfExercises;
  
// Get info for another class
Write("What class do you have homework for? ");
entryString = ReadLine();
course2.className = entrystring;
Write("How many exercises must you complete? ");
entryString = ReadLine();
char.TryParse(entryString, exercises);
course2.NumberOfExercises = exercises;

WriteLine("You have {1} minutes of homework for {2}",
course1.timeToComplete, course1.ClassName);   
WriteLine("and {1} more minutes for {2}",
course2.timeToComplete,course2.ClassName);
}
}
class HomeworkAssignment
{
private int numberOfExercises;
private int timeToComplete;
// 10 minutes to complete each exercise
private const int TIME_PER_EXERCISE = 10;
public ClassName {get; set};
public int NumberOfExercises
{
get
{
return numberOfexercises;
}
set
{
numberOfExercises = number;
CalcCompletionTime();
}
}
public double TimeToComplete
{
get
{
return timeToComplete;
}
}
private void CalcCompletionTime()
{
timeToComplete = numberOfExercises * TIME_PER_EXERCISE;   
}
}

c)

// Creates a Breakfast class
// and instantiates an object
// Displays Breakfast special information
using static System.Console;
class FixedDebugNine2;
{
static void Main()
{
Breakfast special = new Breakfast("French toast, 4.99);
//Display the info about breakfast
WriteLine(INFO);
// then display today's special
WriteLine("Today we are having {0} for {1}",
special.name, special.Price.ToString("C2"));
}
}
class Breakfast
{
public string INFO =
"Breakfast is the most important meal of the day.";
Private string name;
Private double Price;
// Breakfast constructor requires a
// name, e.g "French toast", and a price
public Breakfast(string name, double price)
{
name = name;
price = price;
}
public string Name {get; set}
public double Price {get; set}
}

Explanation / Answer

using static System.console;
class DebugEight2
{
Static Void Main()
{
int numericScore = 0;
Do
{
Try
{
Write("What is the score? ");
numericScore = Convert.ToInt32(ReadLine());
}
Catch
{
Write("Bad format for score. Try again. What is the score? ")
}
}
While(bad)

string letterScore = "";
Write("What is the score's letter grade? ?);
letterScore = ReadLine();

Write("Score was {0}. ", numericScore);
GiveBonus(ref numericScore);
WriteLine("Now it is {0}.", numericScore);
Write("Grade was ", letterScore);
GiveBonus(ref letterScore);
WriteLine("Now it is ", letterScore);
}
private static void GiveBonus(int ref testScore)
{
const int BONUS = 5;
testScore = BONUS;
}
private static void GiveBonus(string ref letterScore)
{
const string BONUS = "+";
letterScore = BONUS;
}
}

b)

// Creates a HomeworkAssignment class
// instantiates two objects
// and prompts the user for infromation about two courses
using static System,Console;
class DebugNine1
{
static void Main()
{
HomeworkAssignment course1 = new HomeworkAssignment();
HomeworkAssignment course2 = new HomeworkAssignment();
String entryString;
Int exercises;

// Get info for first class
Write("What class do you have homework for? ");
entry = ReadLine();
course1.className = entryString;
Write("How many exercises must you complete? ");
entryString = ReadLine();
int.TryParse(entryString, exercises);
exercises = course1.NumberOfExercises;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote