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
Which of the following variable declarations is a correct assignment?
Gwar [14]

Answer:

Option D: double y = 82;

Explanation:

In Java programming, it is acceptable to assign an integer (lower type) to a double type (higher type) variable. By assigning an integer to double type variable using the "=" operator, the integer will be converted to double type implicitly. It is known as the implicit type casting.  

For example, <em>double y = 82</em> will convert integer 82 (integer) to 82.0 (double).

6 0
3 years ago
The instruction format of a computer is given by one indirect bit, opcode bits, register address bits, immediate operand bits an
oksian1 [2.3K]

Answer:

Following are the answer to this question:

Explanation:

A)

The memory size is 1 Giga Bytes which is equal to 2^{30}

\texttt{Number of address bits    \ \ \ \ \ \ \ \ \ \ \ \ \ \            Number of addresses}\\\\ \ \ \ \ 30  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                                 2^{30}= 1073741824

B) \texttt{I \ \ \ Opcode  \ \ \ Register address \ \ \  Immediate operand \ \ \    Memory address}\\\\\\\textt{1 \ bit  \  \ \ \ \ \ 128  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \    2 \ bits   \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   24 \ bits  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \           30 \ bits}\\\\\\            = 2^7 \\\\ = 7 \ bits

calculating the register Bits:

= 64-(1+7+24+30)\\\\=64 -62\ \  bits\\\\= 2\ \ bits\\

C)

Immediate value size while merging the additional benefit with the address field:

= 2^{24} + 2^{30}\\\\= 2^{54}\\\\\texttt{Range before combining(-,+) 24 bits   \ \ \ \ \ \       Range after combining( -,+)54bits}\\\\                         \textt{-2^{12} from + (2^{12}-1)   \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                                    -2^{27} from + (2^{27}- 1)}

= \frac{24}{2} = 12\\\\= \frac{54}{2} = 27

The range is accomplished by dividing the bits by 2 into the two sides of the o and the number is one short to 0.

8 0
3 years ago
, 13 dB correspond to a power ratio of ....?
ohaa [14]

Answer:

19.95

Explanation:

Power ratio (in db) = 10 * log [P(out)/P(in)]

Here, P(in) and P(out) correspond to input and output power in Watts respectively.

This implies, 13 db = 10 * log [P(out)/P(in)]

Rearranging,  log [P(out)/P(in)] = (13/10)

Or, P(out)/P(in) = 10 ^ 1.3 = 19.95

But, P(out)/P(in) corresponds to the power ratio of output and input power.

So the required power ratio corresponds to 19.95

5 0
4 years ago
Within an event-driven program a component from which an event is generated is the ____
mojhsa [17]
The answer is: <span>Source of the Event</span>
7 0
4 years ago
Please tell fast plzzzzzz​
Nata [24]

Answer:

heyyy

your answer is false

HOPE IT HELPS YOU OUT PLEASE MARK IT AS BRAINLIEST AND FOLLOW ME PROMISE YOU TO FOLLOW BACK ON BRAINLY.IN

7 0
3 years ago
Read 2 more answers
Other questions:
  • What device can boost an analog signal? a digital signal?
    12·1 answer
  • The most frequently applied heuristic in problem solving is a(an) _________, which involves repeated tests for differences betwe
    13·1 answer
  • Factor f(x)=x^3-6x^2+9x
    12·1 answer
  • Why does it still say I am ambitious whenever I have the 5 brainliest and almost 700 points?
    15·2 answers
  • The smallest unit of storage is​
    15·1 answer
  • How do i clear my search history ?
    9·2 answers
  • If a base class pointer, p, points to a derived class instance, and both base and derived classes have a method void doIt() whic
    14·1 answer
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    14·1 answer
  • Es el nombre que se le da a la<br> intersección de una columna y fila:
    15·1 answer
  • Which communication technology often takes the place of printed interoffice communication?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!