Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

Students explore these related Databases questions

Question

Show how CH, CH 3can be reduced to

Answered: 3 weeks ago