1 Creates a HomeworkAssignment class 2 instantiates two objects The provided file has 3 and prompts the user for information about two courses syntax and/or logical 4ing static System.Console; errors. Determine the 5 ass DebugNinel problem(s) and fix the 7 static void Main() 8 { HomeworkAssignment coursel = new HomeworkAssignment(); HomeworkAssignment course2 = new HomeworkAssignment(); program. 10 11 12 13 string entryString; int exercises; // Get info for first class Write("What class do you have homework for? "); 14 15 16 entry = ReadLine(); 17 18 19 20 coursel.className = entryString; Write("How many exercises must you complete? "); entryString = ReadLine(entry); int.TryParse(entryString, exercises); 21 22 exercises = coursel.NumberOfExercises; 23 24 // Get info for another class Write("What class do you have homework for? "); entryString = ReadLine (); 25 26 27 course2.className = entrystring; 28 29 30 Write("How many exercises must you complete? "); entryString = ReadLine(); char. TryParse(entryString, exercises); course2.NumberOfExercises = exercises; 31 32 33 34 Writeline ("You have {0} minutes of homework for {1}", coursel.timeToComplete, coursel.ClassName); Writeline ("and {0} more minutes for {1}", 35 36 } 37 38 ass HomeworkAssignment course2.timeToComplete, course2.ClassName); 39 40 private int numberofExercises; 41 private int timeToComplete; 42 // 10 minutes to complete each exercise 43 private const int TIME_PER_EXERCISE = 10; 44 public ClassName {get; set}; 45 public int NumberOfExercises 46 { 47 get 48 49 50 51 { return numberOfexercises; } set 52 53 numberofExercises = number; 54 55 56 } 57 public double TimeToComplete 58 { 59 60 61 62 63 } 64 private void CalcCompletionTime() 65 { 66 CalcCompletionTime(); get { return timeToComplete; timeToComplete = numberofExercises * TIME_PER_EXERCISE

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Instructions
DebugNine1.cs
+
1 Creates a HomeworkAssignment class
2 instantiates two objects
The provided file has
3 and prompts the user for information about two courses
syntax and/or logical
4 ing static System.Console;
errors. Determine the
5 ass DebugNinel
problem(s) and fix the
7 static void Main()
program.
8 {
HomeworkAssignment coursel = new HomeworkAssignment();
HomeworkAssignment course2 = new HomeworkAssignment();
10
11
12
string entrySstring;
int exercises;
13
14
// Get info for first class
Write("What class do you have homework for? ");
15
16
entry = ReadLine();
17
18
coursel.className = entryString;
Write("How many exercises must you complete? ");
entryString = ReadLine(entry);
int.TryParse (entryString, exercises);
19
20
21
22
23
24
25
exercises = coursel.NumberOfExercises;
// Get info for another class
Write("What class do you have homework for? ");
entryString = ReadLine();
26
course2.className = entrystring;
27
Write("How many exercises must you complete? ");
28
29
entryString = ReadLine();
char. TryParse(entryString, exercises);
30
31
32
33
34
course2.NumberofExercises = exercises;
Writeline ("You have {0} minutes of homework for {1}",
coursel.timeToComplete, coursel.ClassName);
Writeline("and {0} more minutes for {1}",
course2.timeToComplete, course2.ClassName);
36 }
37
38 ass HomeworkAssignment
39
40 private int numberofExercises;
41 private int timeToComplete;
42 // 10 minutes to complete each exercise
43 private const int TIME_PER_EXERCISE = 10;
44 public ClassName {get; set};
45 public int NumberofExercises
46 {
47
get
48
{
49
50
return numberOfexercises;
}
51
52
set
53
numberofExercises = number;
54
55
56 }
57 public double TimeToComplete
58 {
59
60
CalcCompletionTime();
get
{
61
62
63 }
64 private void CalcCompletionTime()
65 {
66
return timeToComplete;
}
timeToComplete = numberofExercises * TIME_PER_EXERCISE,
67 }
Transcribed Image Text:Instructions DebugNine1.cs + 1 Creates a HomeworkAssignment class 2 instantiates two objects The provided file has 3 and prompts the user for information about two courses syntax and/or logical 4 ing static System.Console; errors. Determine the 5 ass DebugNinel problem(s) and fix the 7 static void Main() program. 8 { HomeworkAssignment coursel = new HomeworkAssignment(); HomeworkAssignment course2 = new HomeworkAssignment(); 10 11 12 string entrySstring; int exercises; 13 14 // Get info for first class Write("What class do you have homework for? "); 15 16 entry = ReadLine(); 17 18 coursel.className = entryString; Write("How many exercises must you complete? "); entryString = ReadLine(entry); int.TryParse (entryString, exercises); 19 20 21 22 23 24 25 exercises = coursel.NumberOfExercises; // Get info for another class Write("What class do you have homework for? "); entryString = ReadLine(); 26 course2.className = entrystring; 27 Write("How many exercises must you complete? "); 28 29 entryString = ReadLine(); char. TryParse(entryString, exercises); 30 31 32 33 34 course2.NumberofExercises = exercises; Writeline ("You have {0} minutes of homework for {1}", coursel.timeToComplete, coursel.ClassName); Writeline("and {0} more minutes for {1}", course2.timeToComplete, course2.ClassName); 36 } 37 38 ass HomeworkAssignment 39 40 private int numberofExercises; 41 private int timeToComplete; 42 // 10 minutes to complete each exercise 43 private const int TIME_PER_EXERCISE = 10; 44 public ClassName {get; set}; 45 public int NumberofExercises 46 { 47 get 48 { 49 50 return numberOfexercises; } 51 52 set 53 numberofExercises = number; 54 55 56 } 57 public double TimeToComplete 58 { 59 60 CalcCompletionTime(); get { 61 62 63 } 64 private void CalcCompletionTime() 65 { 66 return timeToComplete; } timeToComplete = numberofExercises * TIME_PER_EXERCISE, 67 }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education

Expert Answers to Latest Homework Questions