Question: public class Course { //attributes private int courseReferenceNumber; private int creditHours; private String courseName; private String instructor; // PLEASE START YOUR CODE HERE // *********************************************************

 public class Course { //attributes private int courseReferenceNumber; private int creditHours;

private String courseName; private String instructor; // PLEASE START YOUR CODE HERE

// ********************************************************* // ********************************************************* // PLEASE END YOUR CODE HERE public String

public class Course

{

//attributes

private int courseReferenceNumber;

private int creditHours;

private String courseName;

private String instructor;

// PLEASE START YOUR CODE HERE

// *********************************************************

// *********************************************************

// PLEASE END YOUR CODE HERE

public String toString()

{

return "Course: "+courseName

+ " Instructor: " + instructor

+ " CRN: " + courseReferenceNumber

+ " Credit hours: " + creditHours;

}

}

import java.util.Scanner;

public class PoD {

public static void main( String [] args ) {

Scanner in = new Scanner( System.in );

String courseName = in.nextLine();

String instructor = in.nextLine();

int crn = in.nextInt();

int creditHours = in.nextInt();

// PLEASE START YOUR CODE HERE

// *********************************************************

// *********************************************************

// PLEASE END YOUR CODE HERE

//output using toString() method

System.out.println(newCourse);

System.out.print("END OF OUTPUT");

}

}

PoD. javea Input (main method of PoD.java) The following input values are expected: . a string (courseName): the new course name a string (instructor): the course instructor's name an integer (crn): the course reference number . an integer (creditHours): the credit hours for the course Processing (in PoD.java) .Read in two strings (course name and instructor name) Read in two integers (course reference number and credit hours) . Instantiate the class Course o use the information from input Output the results using the| toString() method of the Course class Output (PoD.java) The output is achieved by using the toString() method in the Course.java object class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!