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
Design an application that declares an array of 20 AutomobileLoan objects. Prompt the user for data for each object, and then display all the values.
write a (GUI) application that asks a user how many integers to be entered, then stores the integers in an array. Allow the user to enter all or a portion of the total integers. Display the integers from first to last, and then display the integers from last to first. Display the minimum and maximum numbers as well as the total and average of the numbers.
using visual studio and C# languange please help with the following In the Chap07 folder of the Student Sample Programs, you will find a file named ChargeAccounts.txt. The file contains a list of a company’s valid charge account numbers. There are a total of 18 charge account numbers in the file, and each one is a 7-digit number, such as 5658845. Create an application that reads the contents of the file into an array or a List. The application should then let the user enter a charge account number. The program should determine whether the number is valid by searching for it in the array or List that contains the valid charge account numbers. If the number is in the array or List, the program should display a message indicating the number is valid. If the number is not in the array or List, the program should display a message indicating the number is invalid.
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
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,