Given main(), define a course base class with methods to set and get the courseNumber and courseTitle. Also define a derived class offeredCourse with methods to set and get instructorName, term, and class Time. Ex. If the input is: ECE287 Digital Systems Design ECE387 Embedded Systems Design Mark Patterson Fall 2018 HE: 2-3:30 pm the output is 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 File is marked as read only 1 import java.util.Scanner; 2 3 public class CourseInformation ( 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 25 26 27 28 30 31 32 33 35 36 37 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); } Current file: CourseInformation.java - Course myCourse - new Course(); OfferedCourse myOfferedCourse new OfferedCourse(); String courseNumber, courseTitle: String CourseNumber, oCourseTitle, instructorNane, term, classTine; courseNumber scnr.nextLine(); courseTitle scar.nextLine(); oCourseNumber scnr.nextLine(); oCourseTitle InstructorNane scnr.nextLine(); scar.nextLine(); tern scor.nextLine(); classTime scar.nextLine(); myCourse.setCourseNumber(courseNumber); myCourse.setCourseTitle(courseTitle); myCourse.printInfo(); myOfferedCourse.setCourseNumber(oCourseNumber); myOfferedCourse.setCourseTitle(oCourseTitle); myOfferedCourse.setInstructorName(instructorName); myOfferedCourse.setTern(tern); myOfferedCourse.setClassTime(classTime); myOfferedCourse.printInfo(); System.out.println(" Instructor Name:" nyOfferedCourse.getInstructorName()); System.out.println(" Term: yOfferedCourse.getTerm()); System.out.println(" Class Time: myOfferedCourse.getClassTine()); 1 public class Course 2 // TODO: Declare private fields courseNumber, courseTitle // TODO: Define mutator setCourseTitle() methods - 11 setCourseNumber(), 3 4 5 6 7 8 9 10 11 12 13 14 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 24 25 26 27 28 29 30 31 32 33 34 35 // TODO: Define accessor methods 11 1 public class offeredCourse extends Course private String instructorName, term, classTine; private String oCouseTitle; 36 37 38 39 // TODO: Define printInfo() } public void setCourseNumber(String CourseNumber) { } getCourseNumber(), getCourseTitle() public void setCourseTitle(String CourseTitle) { this.ocouseTitle -oCourseTitle; } Current file: Course.java - public void setInstructorName(String instructorName) { this. instructorName InstructorName; } Current file: Offered Course.java public void setTerm(String tern) { this.tere term; } public void setClassTime(String classTime) ( this.classTine classTine; public void printInfo() { } public String getInstructorName() { return instructorName; public String getTern() { return term; } public String getClassTime() { return classTine; } Load default template. Load default template....

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 10SA: Consider the definition of the class product Type as given in Exercise 8. Answer the following...
icon
Related questions
Question

Java (derived classes) - Course Information

Given main(), define a Course base class with methods to set and get the courseNumber and courseTitle. Also define a derived class
offeredCourse with methods to set and get instructorName, term, and class Time.
Ex. If the input is:
ECE287
Digital Systems Design
ECE387
Embedded Systems Design
Mark Patterson
Fall 2018
WE: 2-3:30 pm
the output is:
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
File is marked as read only
1 import java.util.Scanner;
2
3 public class CourseInformation {
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 static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
Course myCourse new Course();
OfferedCourse myOfferedCourse = new OfferedCourse();
Current file: CourseInformation.java
String courseNumber, courseTitle;
String CourseNumber, oCourseTitle, instructorName, term, classTime;
courseNumber = scnr.nextLine();
courseTitle scnr.nextLine();
oCourseNumber = scnr.nextLine();
oCourseTitle
scnr.nextLine();
instructorName = scnr.nextLine();
term = scnr.nextLine();
classTime scnr.nextLine();
myCourse.setCourseNumber(courseNumber);
myCourse.setCourseTitle(courseTitle);
myCourse.printInfo();
myOfferedCourse.setCourseNumber(oCourseNumber);
myOfferedCourse.setInstructorName(instructorName);
myOffered Course.setClassTime(classTime);
myOfferedCourse.setCourseTitle (oCourseTitle);
myOfferedCourse.setTerm(term);
myOfferedCourse.printInfo();
System.out.println(" Instructor Name: " + myOffered Course.getInstructorName());
System.out.println(" Term: + nyOfferedCourse.getTerm());
System.out.println(" Class Time: " + myOfferedCourse.getClassTine());
1 public class Coursef
2
// TODO: Declare private fields courseNumber, courseTitle
3
4
5
6
7
8
9
10
11
12
13
14
3
4
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
1 public class Offered Course extends Course {
2
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// TODO: Define mutator methods -
// TODO: Define accessor methods
// TODO: Define printInfo()
}
private String instructorName, term, classTime;
private String oCouseTitle;
setCourseNumber(), setCourseTitle()
public void setCourseNumber (String oCourseNumber) {
}
}
public void setCourseTitle(String oCourseTitle) {
this.oCouseTitle =oCourseTitle;
Current file: Course.java
getCourseNumber(), getCourseTitle()
}
public void setInstructorName(String instructorName) {
this. instructorName instructorName;
}
public void setTerm(String term) {
this.term term;
Current file: OfferedCourse.java →
public void setClassTime(String classTime) {
this.classTime = classTime;
public void printInfo() {
}
}
}
public String getInstructorName() {
return instructorName;
public String getTerm() {
return term;
}
public String getClassTime() {
return classTime;
Load default template..
Load default template...
Transcribed Image Text:Given main(), define a Course base class with methods to set and get the courseNumber and courseTitle. Also define a derived class offeredCourse with methods to set and get instructorName, term, and class Time. Ex. If the input is: ECE287 Digital Systems Design ECE387 Embedded Systems Design Mark Patterson Fall 2018 WE: 2-3:30 pm the output is: 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 File is marked as read only 1 import java.util.Scanner; 2 3 public class CourseInformation { 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 static void main(String[] args) { Scanner scnr = new Scanner(System.in); Course myCourse new Course(); OfferedCourse myOfferedCourse = new OfferedCourse(); Current file: CourseInformation.java String courseNumber, courseTitle; String CourseNumber, oCourseTitle, instructorName, term, classTime; courseNumber = scnr.nextLine(); courseTitle scnr.nextLine(); oCourseNumber = scnr.nextLine(); oCourseTitle scnr.nextLine(); instructorName = scnr.nextLine(); term = scnr.nextLine(); classTime scnr.nextLine(); myCourse.setCourseNumber(courseNumber); myCourse.setCourseTitle(courseTitle); myCourse.printInfo(); myOfferedCourse.setCourseNumber(oCourseNumber); myOfferedCourse.setInstructorName(instructorName); myOffered Course.setClassTime(classTime); myOfferedCourse.setCourseTitle (oCourseTitle); myOfferedCourse.setTerm(term); myOfferedCourse.printInfo(); System.out.println(" Instructor Name: " + myOffered Course.getInstructorName()); System.out.println(" Term: + nyOfferedCourse.getTerm()); System.out.println(" Class Time: " + myOfferedCourse.getClassTine()); 1 public class Coursef 2 // TODO: Declare private fields courseNumber, courseTitle 3 4 5 6 7 8 9 10 11 12 13 14 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 public class Offered Course extends Course { 2 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 // TODO: Define mutator methods - // TODO: Define accessor methods // TODO: Define printInfo() } private String instructorName, term, classTime; private String oCouseTitle; setCourseNumber(), setCourseTitle() public void setCourseNumber (String oCourseNumber) { } } public void setCourseTitle(String oCourseTitle) { this.oCouseTitle =oCourseTitle; Current file: Course.java getCourseNumber(), getCourseTitle() } public void setInstructorName(String instructorName) { this. instructorName instructorName; } public void setTerm(String term) { this.term term; Current file: OfferedCourse.java → public void setClassTime(String classTime) { this.classTime = classTime; public void printInfo() { } } } public String getInstructorName() { return instructorName; public String getTerm() { return term; } public String getClassTime() { return classTime; Load default template.. Load default template...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Predicate
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning