Question: Use the class named Course to answer the questions that follow in this section. 5 public class Course { // instance variables - replace the




Use the class named Course to answer the questions that follow in this section. 5 public class Course { // instance variables - replace the example below with your own private String courseName; private String teacher Name; private int period; /** * Constructor for objects of class Course */ public Course() //default constructor courseName = "APCS"; teacherName = "Coulton"; period = 1; public void setPeriod(int n) { period = n; public String toString() { return courseName + " is taught by " + teacher Name + } " during period " + period; 7 Which line(s) of code would correctly create an object of the Course class? Check all that apply (1 Point) Course c = new Course("Geometry", "Kershner", 2); new Course("Coulton") = new Class(); Course c = new Course(); Course c = new Course(2); 8 Which of the following is a local variable in the Course class? (1 Point) teacherName n a toString period courseName 9 What will print to the terminal window when the following lines of code execute? 6 (1 Point) public static void main() Course myclass = new Course(); System.out.println(myclass); Course@34db6 none of these match the output to the terminal window APCS is during period 3 taught by Ms. Coulton O APCS is taught by Coulton during period 1 10 In the following lines of code, the number 5 is best described by which term? 65 (1 Point) public static void main() { Course myclass = new Course(); myclass.setPeriod(5); } actual parameter formal parameter this O O instance variable local variable C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
