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....

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

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
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