Question: I have this when I submit it, how do I fix my code so that the yellow area goes away? Given main(), define a Course





I have this when I submit it, how do I fix my code so that the yellow area goes away?



Given main(), define a Course base class with methods to set and get the courseNumber and course Title. Also define a derived class Offered Course with methods to set and get instructorName, term, and classTime. Ex. If the input is: ECE287 Digital Systems Design ECE387 Embedded Systems Design Mark Patterson Fall 2018 WF: 2-3:30 pm the output is: Course Information: Course Number: ECE287 Course Title: Digital Systems Design Course Information: Course Number: ECE 387 Course Title: Embedded Systems Design Instructor Name: Mark Patterson Term: Fall 2018 Class Time: WF: 2-3:30 pm File is marked as read only Current file: Courselnformation.java 4 5 6 7 8 9 10 12 13 14 15 16 17 18 1 import java.util.Scanner; 3 public class course Information { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Course myCourse = new Course(); Offered Course myOfferedCourse = new Offered Course(); String courseNumber, courseTitle; 11 String oCourseNumber, oCourseTitle, instructorName, term, classTime; courseNumber = scnr.nextLine(); courseTitle = scor.nextLine(); oCourseNumber = scnr.nextLine(); oCourseTitle = scnr.nextLine(); instructorName = scnr.nextLine(); 19 term = scnr.nextLine(); 20 classTime = scnr.nextLine(); 21 myCourse.setCourseNumber(courseNumber); myCourse.setCourseTitle(courseTitle); myCourse.printInfo(); myOffered Course.setCourseNumber (CourseNumber); myOfferedCourse.setCourseTitle(oCourseTitle); myOfferedCourse.setInstructor Name(instructorName); myOffered Course.setTerm(term); 30 myOfferedCourse.setClassTime (classTime); 31 myOffered Course.printInfo(); 32 33 System.out.println(" Instructor Name: " myOfferedCourse.getInstructorName()); 34 System.out.println(" Term: myOffered Course.getTerm(); 35 System.out.println(" Class Time: + myOfferedCourse.getClassTime()); } 37 } 22 23 27 28 + 36 Current file: Course.java 1 public class Course 21 3 private String courseNumber; 4 private String courseTitle; 5 6 public void setCourseNumber (String courseNumber) 7 { 8 this.courseNumber = courseNumber; 9 } 10 11 public void setCourseTitle(String courseTitle) 12 { 13 this.courseTitle = courseTitle; 14 } 15 16 17 public String getCourseNumber() 18 { 19 return courseNumber; 20 } 21 22 public String getCourseTitle() 23 { 24 return courseTitle; 25 } 26 27 28 public void printInfo() 29 { 30 System.out.println ("Course Information: "); 31 System.out.println ("Course Number: " + courseNumber); 32 System.out.println("Course Title: + courseTitle); 33 } 34 } Current file: Offered Course.java 1 public class Offered Course extends Course 2 { private String instructorName; private String term; private String classTime; public void setInstructorName (String instructorName) { this. instructorName = instructorName; } public void setTerm(String term) { this.term = term; } 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 } public void setClassTime (String classTime) { this.classTime = classTime; } public String getInstructorName) { return instructorName; } public String getTerm() { return term; } public String getClassTime() { return classTime; } Enter program input (optional) ECE287 Digital Systems Design ECE387 Embedded Systems Design Mark Patterson Fall 2018 WF: 2-3:30 pm 1: Compare output 0/1 Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input ECE287 Digital Systems Design ECE387 Embedded Systems Design Mark Patterson Fall 2018 WF: 2-3:30 pm Your output Course Information: Course Number: ECE287 Course Title: Digital Systems Design Course Information: Course Number: ECE387 Course Title: Embedded Systems Design Instructor Name: Mark Patterson Term: Fall 2018 class Time: WF: 2-3:30 pm Expected output Course Information: Course Number: ECE287 Course Title: Digital Systems Design Course Information: Course Number: ECE 387 Course Title: Embedded Systems Design Instructor Name: Mark Patterson Term: Fall 2018 class Time: WF: 2-3:30 pm 2: Compare output 0/1 Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input CSE 174 Systems I CSE 274 Systems II Dr. Susan Thomas Spring 2019 MWF: 10-10:50 am Your output Course Information: Course Number: CSE 174 Course Title: Systems I Course Information: Course Number: CSE 274 Course Title: Systems II Instructor Name: Dr. Susan Thomas Term: Spring 2019 class Time: MWF: 10-10:50 am Expected output Course Information: Course Number: CSE 174 Course Title: Systems I Course Information: Course Number: CSE 274 Course Title: Systems II Instructor Name: Dr. Susan Thomas Term: Spring 2019 Class Time: MWF: 10-10:50 am 3: Compare output a 0 Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input CEC 101 Introduction to Computing CEC 102 Computing and beyond Dr. Rob Adams Fall 2019 MWF: 3-4:50 pm Your output Course Information: Course Number: CEC 101 Course Title: Introduction to Computing Course Information: Course Number: CEC 102 Course Title: Computing and beyond Instructor Name: Dr. Rob Adams Term: Fall 2019 Class Time: MWF: 3-4:50 pm Expected output Course Information: Course Number: CEC 101 Course Title: Introduction to Computing Course Information: Course Number: CEC 102 Course Title: Computing and beyond Instructor Name: Dr. Rob Adams Term: Fall 2019 Class Time: MWF: 3-4:50 pm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
