1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elanso [62]
4 years ago
15

This project is to mimic a meeting request system by checking the requesting party’s validity, and the number of people attendin

g. Then it will make a decision as to whether the meeting can take place and display an informative message.
Display a welcome message and then ask the user to enter his/her name Display a personal welcome message by addressing the user by his/her name. Declare a constant and assign a number to it as the Conference Room capacity.

Ask the user how many people are attending the meeting. Display a meaningful message for each of the three different scenarios. The message informs the user whether he/she can have the requested room and also displays the number of people that must be excluded or that can still be invited based on the room capacity. Here are the three scenarios.

people attending are fewer than the Room Capacity
people attending are more than the Room Capacity
people attending are exactly the same as the Room Capacity

The system will keep running until the user quits (meaning all this happens in a loop)
Computers and Technology
1 answer:
alexgriva [62]4 years ago
4 0

Answer:

See explaination for the program code

Explanation:

Meeting.java

------

import java.util.Scanner;

public class Meeting {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

final int ROOM_CAPACITY = 100;

int numPeople, diff;

String name;

System.out.println("****** Meeting Organizer ******");

System.out.print("Enter your name: ");

name = input.nextLine();

System.out.println("Welcome " + name);

do{

System.out.print("\nHow many people would attend the meeting? (type 0 to quit): ");

numPeople = input.nextInt();

if(numPeople < 0)

System.out.println("Invalid input!");

else if(numPeople != 0)

{

if(numPeople > ROOM_CAPACITY)

{

diff = numPeople - ROOM_CAPACITY;

System.out.println("Sorry! The room can only accommodate " + ROOM_CAPACITY +" people. ");

System.out.println(diff + " people have to drop off");

}

else if(numPeople < ROOM_CAPACITY)

{

diff = ROOM_CAPACITY - numPeople;

System.out.println("The meeting can take place. You may still invite " + diff + " people");

}

else

{

System.out.println("The meeting can take place. The room is full");

}

}

}while(numPeople != 0);

System.out.println("Goodbye!"); }

}

output

---

****** Meeting Organizer ******

Enter your name: John

Welcome John

How many people would attend the meeting? (type 0 to quit): 40

The meeting can take place. You may still invite 60 people

How many people would attend the meeting? (type 0 to quit): 120

Sorry! The room can only accommodate 100 people.

20 people have to drop off

How many people would attend the meeting? (type 0 to quit): 100

The meeting can take place. The room is full

How many people would attend the meeting? (type 0 to quit): 0

Goodbye!

You might be interested in
NEW
creativ13 [48]

Answer:

The correct answer is B. The behavior model of leadership did not address all of the behaviors that leaders may possess.

Explanation:

The behavioral leadership model is a psychological and strategic theory that analyzes the different behaviors and behavior patterns of people who assume strategic or leadership roles within an organization, company or industry.

This theory does not analyze all the behavior patterns of leaders, as it only takes into account the most repeated or common patterns, such as confrontation, pacification or collaboration, for example, but leaving aside other not so common or intermediate behaviors. among those named.

3 0
3 years ago
Q.No.3. A filling station (gas station) is to be set up for fully automated operation. Drivers swipe their credit card through a
scZoUnD [109]

Answer:

Following are the 5 problems, that can arise in this scenario:

Explanation:

  • When the driver swipes its credit or debit card, its connection with both the card company could not be formed due to the poor or ineffective development, therefore the driver may not put any fuel from its vehicle.  
  • It still wants to spend energy even after the card is read as incorrect.  
  • So, its total price to just be debited from the credit or debit card shall be much more and less than the real cost as well as the deduction of both the fuel should be overestimated.  
  • Its information may not adjust when a driver uses its device because the next driver could no matter how long only use the device.
  • Its fuel limit to also be established when the vehicle has stopped its card would be faulty as well as a certain restriction would not cause its device to be misused.
3 0
3 years ago
How many total channels are available in the United States for wireless LAN use in the unlicensed 2.4ghz ism band ?
Usimov [2.4K]
Answer: 14 channels are available in the unlicensed 2.4 GHz ISM band.
3 0
3 years ago
In this assignment, you are to create a class named Payroll. In the class, you are to have the following data members: name: Str
wlad13 [49]

Answer:

Here is the PayRoll class:

// PayRoll.java

package payroll;  // creates payroll package for project

public class Payroll {   //class definition

  private String name;   //private String type member variable to store name

  private String id;  //private String type member variable to store id

  private int hours;  //private int type member variable to store work hours

  private double rate;    //private double type member variable to store payrate of the employee

  public Payroll()    {  //no argument constructor of PayRoll

      name = "";   //initialize name field

      id = "";   //initialize id field

      hours = 0;  //initialize hours field

      rate = 0.0;    }  //  initialize rate field

  public Payroll(String NAME, String ID, int HOURS, double RATE)    { //parameterized constructor

      setName(NAME);  //sets name value

      setId(ID); //sets id value

      setHours(HOURS);  //sets hours value

      setRate(RATE);    }  //sets rate value

  public void setName(String NAME)    {  //mutator method to set name

      if(NAME.equals(""))        {  //if name field is empty

          throw new IllegalArgumentException("An employee name should not be empty.");        }     //throws exception

      name = NAME;    }  

  public void setId(String ID)    {        //mutator method to set id

      if(ID.length() != 3 || !Character.isLetter(ID.charAt(0))|| !Character.isDigit(ID.charAt(1)) || !Character.isDigit(ID.charAt(2)))        {  //if statement checks if the length of the id is not 3, or first character of id is not a letter, or second or third character of id is not a digit

          throw new IllegalArgumentException("An employee id should have the form LNN.");        }        //throws exception

      id = ID;    }    

  public void setHours(int HOURS)    {  //mutator method to set hours

      if(HOURS < 0 || HOURS > 84)        { //checks if working hours are less than 0 or greater than 84

          throw new IllegalArgumentException("An employee's hours should neither be negative nor greater than 84");        }    //throws exception    

      hours = HOURS;    }  

  public void setRate(double RATE)    {    //mutator method to set rate

      if(RATE < 0 || RATE > 25.00)        {  //checks if pay rate is less than 0 or greater than 25.00

          throw new IllegalArgumentException("An employee's pay rate should neither be negative nor greater than 25.00");        }         //throws exception    

      rate = RATE;    }    

  public String getName()    {  //accessor method to get value of name

      return name;    }   //returns the current value of name

  public String getId()    { //accessor method to get value of id

      return id;    }  //returns the current value of id

  public int getHours()    {  //accessor method to get value of hours

      return hours;    }    //returns the current value of hours

   public double getRate()    {  //accessor method to get value of rate

      return rate;    }  } //returns the current value of rate

Explanation:

Here is the Main() class:

import java.util.Scanner;  //to accept input from user

public class Main {  //Main class definition

  public static void main(String[] args)   {//start of main() function

      Payroll pay = new Payroll();  //creates object i.e. pay of PayRoll class

      Scanner sc = new Scanner(System.in);  //creates Scanner class object

      String name,id; //declare variables to hold name and id

      int hour;  //declare variable to store hour

      double rate; //declare variable to store pay rate

      System.out.print("Enter the employee's name: "); //prompts user to enter employee name

      name = sc.nextLine();  //reads input value of name

      pay.setName(name);  //use pay object to access mutator method to set name to input name value

      System.out.print("Enter employee's id (LNN form): "); //prompts user to enter employee id

      id = sc.nextLine();  //reads input value of id

      pay.setId(id);  //use pay object to access mutator method to set id to input id

      System.out.print("Enter the employee's working hours: "); //prompts user to enter employee hours

      hour = sc.nextInt();  //reads input value of hour

      pay.setHours(hour);  // set input hours

      System.out.print("Enter the employee's pay rate: "); //prompts user to enter employee pay rate

      rate = sc.nextInt(); //reads input value of rate

      pay.setRate(rate);  // set pay rate

      System.out.println("Employee Data: \n");  //displays the employee data

      System.out.println("Employee's Name: " + pay.getName());  //calls getName accessor method to get current value of name field and display it

      System.out.println("Employee's ID: " + pay.getId());  //calls getId accessor method to get current value of id field and displays it

      System.out.println("Employee's Hours: " + pay.getHours());  //calls getHours accessor method to get current value of hours field and displays it

      System.out.println("Employee's Pay Rate: " + pay.getRate()); //calls getRate accessor method to get current value of rate field and displays it

  }

}

Here IllegalArgumentException is thrown which is used to show that a method is passed an illegal argument.

The screenshot of program and its output is attached.

5 0
3 years ago
What technology was implemented on apple computer printer ports to facilitate file and printer sharing?
Shtirlitz [24]

A technology which was implemented on Apple computer printer ports to facilitate file and printer sharing is LocalTalk.

<h3>What is a printer?</h3>

A printer can be defined as an electronic output (peripheral) device that is designed and developed for printing paper documents containing texts or images on a computer system.

On Apple computer printer ports, a technology which was implemented to facilitate file and printer sharing is LocalTalk, which is typically implemented based on the physical layer of the AppleTalk networking system.

In this context, we can infer and logically deduce that a technology which was implemented on Apple computer printer ports to facilitate file and printer sharing is LocalTalk.

Read more on printer here: brainly.com/question/17100575

#SPJ1

4 0
2 years ago
Other questions:
  • Using the SUM function allows a series of numbers to be 1. Multiplied 2. Subtracted 3 Added 4. Divided
    11·1 answer
  • In printing systems using ____, a disk accepts output from several users and acts as a temporary storage area for all output unt
    14·1 answer
  • What is the function of napier's bones<br>​
    8·1 answer
  • Which of the following statements is false? Group of answer choices A subclass is often smaller than its superclass. A superclas
    12·1 answer
  • When nat hides the source ip of an originating device, this is known as ________?
    15·2 answers
  • HELP I WILL MARK BRAINLIEST!!! I NEED ASAP!!!
    5·1 answer
  • Interface elements include but are not limited to:
    8·1 answer
  • What can you use on Code.org's Web Lab to find and fix problems when you are writing code for your website?
    13·1 answer
  • PLEASE HELP ASAPP!!
    7·1 answer
  • .WAP to enter monthly sale of Salesman and give him commission i.E. If the monthly sale is more than 500000 then commision will
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!