Question

Display a welcome message and then ask the user to enter his/her name Display a personal welcome message by addressing the us
Welcome to the Meeting Request System. May I know your name? Frodo Baggins Hello, Frodo Baggins, how many people are attendin
Review String methods Use decision/selection statement Use repetition statement
java TM SOFTWARE SOLUTIONS Foundations of Program Design 9TH EDITION
0 0
Add a comment Improve this question Transcribed image text
Answer #1
package abc1;

import java.util.Scanner;

public class MeetingRoom {

        public static void main(String[] args) {
                final int capacity = 60;
                int no;
                Scanner scan;
                String name, option;
                
                do {
                System.out.println("Welcome to the Meeting Request System. May I know your name?");
                scan=new Scanner(System.in);
                name = scan.nextLine();
                System.out.println("Hello, " + name + ", how many people are attending the meeting?");
                no = scan.nextInt();
                if(no<capacity)
                        System.out.println("\nWonderful, the room is pretty big, You can still invite another " + 
                                        (capacity-no) + " people to the meeting.\n");
                else if(no>capacity)
                        System.out.println("\nSorry, but the room is not big enough. You have to exclude " +
                                        (no-capacity) + " people from the meeting.\n");
                else
                        System.out.println("\nThat is perfect. The room has the excat number of seats you are asking for!\n");
                System.out.println("Would you like to make another request?");
                option  = scan.next();
                }while(option.contentEquals("y") || option.contentEquals("Y"));
        }

}

Add a comment
Know the answer?
Add Answer to:
Display a welcome message and then ask the user to enter his/her name Display a personal...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Ask the user to enter a message Ask the user how many time they want to...

    Ask the user to enter a message Ask the user how many time they want to print the message Then use "while","do-while" and "for" loop to print the message. Show the number at the beginning of the lines when printing. For example: Enter your message: Welcome to Java How many time you want to print this message: 3 Using "while" loop: 1=> Welcome to Java 2=> Welcome to Java 3=> Welcome to Java Using "do-while" loop: 1=> Welcome to Java...

  • For Java Keyboard Input Lab3 Ask the user for their name. Then display their name to...

    For Java Keyboard Input Lab3 Ask the user for their name. Then display their name to prove that you can recall it. Ask them for their age. Then display that. Finally, ask them for how much they make and display that. You should use the most appropriate data type for each variable. Hello. What is your name? Dennis Hi, Dennis! How old are you? 37 So you're 37, eh? That's not old at all! How much do you make, Dennis?...

  • RandomGame.cpp (2pt) Write a program that asks the user to enter his/her name. Then begin a...

    RandomGame.cpp (2pt) Write a program that asks the user to enter his/her name. Then begin a do while loop that asks the user to enter a number between 1 and 10. Have the random number generator produce a number 1 and 10. Display the user’s name and both numbers to the screen. Compare the two numbers and report if the entered number is greater than, less than, or the same as the generated number. Ask the user if he/she’d like...

  • Guess the number! You will create a program that will ask the user to guess a...

    Guess the number! You will create a program that will ask the user to guess a number between 1 and 10. The pseudocode is below. Be sure to import random at the beginning of your code and use a comment block explaining what your program does #Guess the number week 4 #Name: #Date: #Random number, loop while true #ask user for number. #if number is too high or too low, tell user, if they guessed it break out of loop...

  • write in python idle Write full program that asks the user to enter his/her name then...

    write in python idle Write full program that asks the user to enter his/her name then repeatedly ask to enter the temperature in Fahrenheit and convert it to Celsius, the program should then prompt the user if he/she wants to continue or exit the program. The formula for conversion is: °C = (°F - 32) x 5/9 The program should use a function for the conversion. An Example of a sample run should appear on the screen like the text...

  • This program will ask the user to enter a number of players, then ask the user...

    This program will ask the user to enter a number of players, then ask the user for each player's name and score. Once all of the players have been entered, the program will display a bar chart with each of their scores scaled as a percentage of the maximum score entered. See below for details on exactly how this should work - an example transcript of how the program should work is shown below (remember that values entered by the...

  • Java programming for ticket price calculator.  It should ask the user if they would like to process...

    Java programming for ticket price calculator.  It should ask the user if they would like to process another ticket order. They should indicate their selection with a Y or N. If they indicate yes, then it should repeat the entire program with the exception of the welcome screen. If they indicate no, it should show the final thank you message and end the program. If they indicate an invalid answer, it should display an error and re-prompt them for a Y...

  • Create a program that will ask for the name, age, address, and favorite food of the...

    Create a program that will ask for the name, age, address, and favorite food of the user. After which, create a calculator with ADD, SUB, MULTI, and DIV. Then the program will display all the user have inputted in bash program ACTIVITY 4: Create a program that will ask for the name, age, address, and favorite food of the user. After which create a calculator with ADD, SUB, MULTI, and DIV. Then the program will display all the user have...

  • Write python program using IDLE Write a full program that asks the user to enter his/her...

    Write python program using IDLE Write a full program that asks the user to enter his/her name then repeatedly ask to enter the temperature in Fahrenheit and convert it to Celsius, the program should then prompt the user if he/she wants to continue or exit the program. The formula for the conversion is: °C = (°F - 32) x 5/9 The program should use a function for the conversion. An Example of a sample run should appear on the screen...

  • This is a Java text only program. This program will ask if the user wants to...

    This is a Java text only program. This program will ask if the user wants to create a music playlist. If user says he or she would like to create this playlist, then the program should first ask for a name for the playlist and how many songs will be in the playlist. The user should be informed that playlist should have a minimum of 3 songs and a maximum of 10 songs. Next, the program will begin a loop...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT