EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 9, Problem 6PE

Explanation of Solution

Program:

File name: “TimesAndInstructors.java

//Import necessary header files

import java.util.Scanner;

//Define a class named TimesAndInstructors

public class TimesAndInstructors

{

    //Define main method

    public static void main(String[] args)

    {

        //Storing the courses, times and instructors

String courses[]= {"CIS101","CIS210","MKT100","ACC150","CIS101"};

String time[]= {"Mon 9 am","Mon 11 am","Tues 8:30 am","Tues 6 pm","Fri 1 pm"};

String instructor[]= {"Johnson","Patel","Wong","Deitrich","Lennon"};

        //Create an object to the Scanner class

        Scanner sc = new Scanner(System.in);

        //Prompt the user to enter the course name

        System.out.println("Enter course name: ");

        String str=sc.next();

        //Assign false value to flag

        boolean flag=false;

//Iterating through the courses and print the time and instructor

        for(int i=0;i<courses...

Blurred answer
Students have asked these similar questions
Write an application containing three parallel arrays that hold 10 elements each.  The first array hold four-digit student ID numbers, the second array holds first names, and the third array holds the students’ grade point averages.  Use dialog boxes to accept a student ID number and display the student’s first name and grade point average.  If a match is not found, display an error message that includes the invalid ID number and allow the user to search for a new ID number. java program
JAVA Write an application containing three parallel arrays that hold 10 elements each. The first array hold four-digit student ID numbers, the second array holds first names, and the third array holds the students’ grade point averages. Use dialog boxes to accept a student ID number and display the student’s first name and grade point average. If a match is not found, display an error message that includes the invalid ID number and allow the user to search for a new ID number.
Write an application that displays a series of at least five student ID numbers (that you have stored in an array) and asks the user to enter a numeric test score for the student. Create a ScoreException class, and throw a ScoreException for the class if the user does not enter a valid score (less than or equal to 100). Catch the ScoreException and then display an appropriate message. In addition, store a 0 for the student’s score. At the end of the application, display all the student IDs and scores. Save the files as ScoreException.java and TestScore.java.
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,