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...
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...
I am trying to write a java program that determines if an inputted year is a...
I am trying to write a java program that determines if an inputted year is a leap year or not, but I am not able to use if else statements how would I do it. I don't need the code just advice.
Write a program that determines the change to be dispensed from a vending machine. An item...
Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and 1 dollar, in 5-cents increments (25, 30, 35, . . . 90, 95, or 100), and the machine accepts only a single dollar bill to pay for the item. (Explain with algorithms if you can please!)
Give the best possible definition of food security explaining how good food security leads to meeting...
Give the best possible definition of food security explaining how good food security leads to meeting the six dietary principles, good IDATME and good WWFQ.   You must identify and explain the six dietary principles (Adequacy, Balance, Energy Control, Nutrient Density, Moderation, Variety), and each component of IDATME and WWFQ List the six nutrient classes explain how each of those nutrient classes contribute, individually and in conjunction with other nutrient classes, to the ability to exercise.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT