Application that stores at least four different course names

Assignment Help JAVA Programming
Reference no: EM13940261

The application as written does not display certain class names included in the instructions as written.

Write an application that stores at least four different course names and meeting days and times in a two-dimensional string array. Allow the user to enter a course name (such as CIS 110) and display the day of the week and times that the course is held (such as Th 330). If the course does not exist, display an error message.

import javax.swing.JOptionPane;
import java.util.Scanner;

public class Schedule {
public static void main(String[] args) {
//declare variables and arrays
final int NUM_RANGES = 4;
int sub = NUM_RANGES - 1;

String[][] classNames = {
{"COM 209", "MAT 201", "MAT 141", "ENG 220"},
{"Mon 1:00","Tue 8:30","Thu 7:30","Fri 9:15",}
};

//get input
String classInput = JOptionPane.showInputDialog("Please input a class name: ");

//match to output and print
while(sub >= 0)
--sub;

if (classInput.equals(classNames[0])) {
JOptionPane.showMessageDialog(null, "Class time is: " + classNames[0][0]);
System.exit(0);
}
else if (classInput.equals("COM 209")) {
JOptionPane.showMessageDialog(null, "Class time is: " + classNames[1][1]);
System.exit(0);
}
else if (classInput.equals("MAT 201")) {
JOptionPane.showMessageDialog(null, "Class time is: " + classNames[2][2]);
System.exit(0);
}
else if (classInput.equals("MAT 141")) {
JOptionPane.showMessageDialog(null, "Class time is: " + classNames[3][3]);
System.exit(0);
}
else if (classInput.equals("ENG 220")) {
JOptionPane.showMessageDialog(null, "Class time is: " + classNames[4][4]);
System.exit(0);
}

else {
JOptionPane.showMessageDialog(null, "Please enter a valid class name.");
System.exit(0);
}
}
}

Reference no: EM13940261

Questions Cloud

In a transaction for the sale of an auto painting facility : In a transaction for the sale of an auto painting facility, Bright Auto Colors Company tells Custom Cars Corporation that the paints and other supplies on-site are included. The contract says nothing about the supplies on-site, but does state, “This ..
What is the expected rate of return to an investor : What is the expected stock price 4 years from now? The discount rate is 10%. What is the expected rate of return to an investor who buys the stock now and sells it in1 year?
Develop change management-communication strategy : Develop a change management and communication strategy incorporating organisation development aims and activities, strategic planning activities, together with an integrated communication strategy.
Organizational constraint on public criminal justce agencies : What are the organizational constraints on public criminal justice agencies? How do these constraints affect operations?
Application that stores at least four different course names : The application as written does not display certain class names included in the instructions as written.
What are job-order costing and process costing : What are job-order costing and process costing? What types of firms use job-order costing? Process costing? Give some examples of service firms that might use job-order costing, and explain why it is used in those firms.
Cost formula for its supplies cost : Ingram Framing's cost formula for its supplies cost is $1,120 per month plus $12 per frame. For the month of June, the company planned for activity of 610 frames,
What is role of material requisition forms in costing system : What is the role of materials requisition forms in a job-order costing system? Time tickets? Predetermined overhead rates?
Components of the new product development process : Choose two components of the new product development process e.g. idea generation, product development, market analysis, commercialization or product launch and describe and analyse the product development strategy adopted by an energy company as ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Design and implement a java program that will gather info

Design and implement a Java program that will gather a user's first name, middle initial, lastname, age in years, and 3 lucky numbers. The program should output the following based on the user's input

  Make a program that show the sales amount

You have to make a program that show the sales amount. Be sure to include comments. Comments should be included in the program to explain your calculations and program.

  Design a small wbis using elements from the disciplines

Design a small WBIS using elements from the disciplines of web design, database design, software engineering and object modelling;be able to develop a small WBIS using HTML forms, Java Servlets and cookies.

  Write a java gui program that has eight tabs

I need to write a java gui program that has 8 tabs, General, Options, Customers, Contractors, Pools, Hot Tubs, Temp Calc, and Length Calc. Each pane needs an Exit button that will close only that pane.

  App that allows the user to enter a series of numbers

Write an app that allows the user to enter a series of numbers and manipulate them. The app should provide users with the option of adding or multiplying the numbers.

  Write an android app which will sense the room temperature

Write an Android app which will sense the room temperature. Write the Cell identity Gsm and Carrier Configuration Manager Class code.

  Write java program to accept two words as input

Write a Java program that accepts two words as input and determines if one of them is resulting from changing the order of the others' letters.

  Method that reflects overloading

Example of a method that reflects overloading, and one that reflects polymorphism

  Print out the characters in the string

White a program that prompts the user to input a String and then print out the characters in the string one per line.

  What is mean by swing and awt

What is mean by Swing and AWT and compare the statements break and continue with example in terms of their functions

  The federal acquisition regulation

According to the text, the Federal Acquisition Regulation (FAR) is a body of law that governs U.S. Federal Government's procurement process. The FAR is prepared, issued and maintained under the joint command of the Secretary of Defense, the Administr..

  What is an example of a javascript framework

What is an example of a JavaScript(r) framework? In the framework you have described, what is an example of an application that would work well on the site you are building for the class? What is the purpose of the application and how will it enha..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd