Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java Programming: The program should consists of three sub classes. the first cl

ID: 654163 • Letter: J

Question

Java Programming:

The program should consists of three sub classes.

the first class, studentManager, class consists of list of students and function such as to add student, add course and get student iterator, which allows an external class to iterate through the list.

interface <E> iterator

the second class is the , student class that manages the student attributes. this should return the course iterator that returns similar to the student iterator, for the list of courses.

the third class is the transcrpt class, that display the data on the screen. it consists of overload methods such as printresults, that takes the student iterator and id as arguments and display the student transcript for the selected student.

Explanation / Answer

Here the functionality of programs is built with the help of control structures. Control structures make different functions possible depending on the variables of the program. Below, an example of an if - else if - else control structure, in which a different function is executed depending on the result of the comparison.

In the example a string Accelerate is printed if the value of the variable speed is smaller than 110, the string Break if thespeed is greater than 120, and the string Cruising in other cases.

int speed = 105; if (speed < 110)

{

System.out.println("Accelerate");

}

else if (speed > 120)

{ System.out.println("Break"); }

else { System.out.println("Cruising"); }

Because in the example above the value of the variable speed is 105, the program will always print the string Accelerate. Remember that the comparison of strings is done with the equals method that belongs to the String class. Below is an example in which an object created from Java's scanner class is used to read the input of a user. The program checks if the strings entered by the user are equal.

Scanner reader = new Scanner(System.in);

System.out.print("Enter the first string: ");

String first = reader.nextLine();

System.out.print("Enter the second string: ");

String second = reader.nextLine();

System.out.println(); if (first.equals(second))

{

System.out.println("The strings you entered are the same!");

}

else

{

System.out.println("The strings you entered weren't the same!");

}

The functionality of the program depends on the user's input.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote