Question

In: Computer Science

Write a program that determines the best possible meeting time for four people. The possibilities for...

Write a program that determines the best possible meeting time for four people. The possibilities for meeting times are 8:00-12:00, 12:00-18:00 or 18:00-23:00.

You should begin by asking the first user to choose a meeting time. The user should enter the number 1 for the 8:00-12:00 meeting time, the number 2 for the 12:00-18:00 meeting time, or the number 3 for the 18:00-23:00 meeting time

Solutions

Expert Solution

Meeting.java

package meeting;

import java.util.Scanner;

public class Meeting {
//static int i;
   public static void main(String[] args) {
       System.out.println("Enter the meeting slot for four people : ");
       Scanner scan = new Scanner(System.in);
       int i = scan.nextInt();
       switch (i) {
       case 1:
           System.out.println("The meeting time is : " + "8:00 - 12.00");
           break;
       case 2:
           System.out.println("The meeting time is : " + "12:00 - 18.00");
           break;
       case 3:
           System.out.println("The meeting time is : " + "18:00 - 23.00");
           break;
       default:
           System.out.println(" Please enter the correct slot number between 1 to 3?");
           break;
       }
       scan.close();

   }

}

Output:

case 1:

Enter the meeting slot for four people :
1
The meeting time is : 8:00 - 12.00

case2:

Enter the meeting slot for four people :
2
The meeting time is : 12:00 - 18.00

case3:

Enter the meeting slot for four people :
3
The meeting time is : 18:00 - 23.00

default case:

Enter the meeting slot for four people :
4
Please enter the correct slot number between 1 to 3?


Related Solutions

write a c++ program an expression that determines if an integer, n is a negative four...
write a c++ program an expression that determines if an integer, n is a negative four digit number. write a c++ program an expression that determines if a string, wd, equals "so" ignoring case.
Write a program that determines which of the company’s four divisions (Northeast, Southeast, Northwest, and Southwest)...
Write a program that determines which of the company’s four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for the quarter. It should include the following two functions, which are called by main. Rewrite the “getSales” function in the “winning division”program. ◦The function has no return value; ◦The function accepts one reference variable to a double and one string variable as arguments. ◦Your program still needs to call getSalesfour times for each division to get their quarterly sales...
Programming Assignment #2, Processes Write a C program (time_shm.c) that determines the amount of time necessary...
Programming Assignment #2, Processes Write a C program (time_shm.c) that determines the amount of time necessary to run a command from the command line. This program will be run as ./time <command [args...]> and will report the amount of elapsed time to run the specified command. This will involve using fork() and execvp() functions, as well as the gettimeofday() function to determine the elapsed time. It will also require the use of two different IPC mechanisms. The general strategy is...
. Write a C program that asks the user a multiple-choice question and shows four possible...
. Write a C program that asks the user a multiple-choice question and shows four possible answers, (a) through (d). Prompt the user to input a response as a character. If the user enters the correct response, print a message stating that the answer is correct. If the user enters an incorrect response, print a message stating that the answer is wrong. If the user enters anything other than the letters a, b, c, or d, print a message stating...
Write a java program using the following instructions: Write a program that determines election results. Create...
Write a java program using the following instructions: Write a program that determines election results. Create two parallel arrays to store the last names of five candidates in a local election and the votes received by each candidate. Prompt the user to input these values. The program should output each candidates name, the votes received by that candidate, the percentage of the total votes received by the candidate, and the total votes cast. Your program should also output the winner...
PYTHON PROGRAM: Write a program that determines the day of the week for any given calendar...
PYTHON PROGRAM: Write a program that determines the day of the week for any given calendar date after January 1, 1900, which was a Monday. This program will need to account for leap years, which occur in every year that is divisible by 4, except for years that are divisible by 100 but are not divisible by 400. For example, 1900 was not a leap year, but 2000 was a leap year.
Write a program that determines a student’s grade. The program will read three types of scores...
Write a program that determines a student’s grade. The program will read three types of scores (quiz, mid-term, and final scores) and determine the grade based on the following rules: -if the average score =90% =>grade=A -if the average score >= 70% and <90% => grade=B -if the average score>=50% and <70% =>grade=C -if the average score<50% =>grade=F Using Switch Statement Need to code to be simple to understand. No pointers should be used
Write a program in JAVA that takes in two words, and then it recursively determines if...
Write a program in JAVA that takes in two words, and then it recursively determines if the letters of the first word are contained, in any order, in the second word. If the size of the first word is larger than the second then it should automatically return false. Also if both strings are empty then return true. YOU MAY NOT(!!!!!!!!!!): Use any iterative loops. In other words, no for-loops, no while-loops, no do-while-loops, no for-each loops. Use the string...
Write a program that determines whether an input string is a palindrome; that is, whether it...
Write a program that determines whether an input string is a palindrome; that is, whether it can be read the same way forward and backward. At each point, you can read only one character of the input string; do not use an array to first store this string and then analyze it (except, possibly, in a stack implementation). Consider using multiple stacks. In Pseudocode please
Write a program in PYTHON that determines the cost of painting the walls of a windowless...
Write a program in PYTHON that determines the cost of painting the walls of a windowless room. There is one door and it will be painted the same color as the walls. The problem requires a main function and two custom functions that are imported from a custom module that you create. In main, the program should prompt the user for five inputs shown in blue in the Sample Output below: the length, width, and height of the room in feet. the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT