Answer ALL the problems, by using JAVA Show me the OUTPUT! ** Make sure you answ
ID: 3707938 • Letter: A
Question
Answer ALL the problems, by using JAVAShow me the OUTPUT! ** Make sure you answer each part ** for a good rating 1 Assignment 1 Our first assignment will reinforce the difference between static and non- until Monday when I get the chance to teach you about the difference people in the rooms of a building. The class has the attributes static variables and methods. This one is the easiest, but will have to wait Create a class RoomOccupancy that can be used to record the number of numberInRoom- the number of people in a room totalNumber the total number of people in all rooms. Since this is shared among all instances of RoomOccupancy static variable. Make it private too. The class has the following methods: adiaeToteo ads a person to therom of totalNumber . removeOneFromRoom - removes a person from the room, ensuring that numberInRoom does not go below zero, and decreases the value of totalNumber as needed getNumber -returns the number of people in the room . getTotal -a static method that returns the total number of people Create a few Roomoccupancy classes and confirm they work. 2 Exercise 2 complex number. A complex Create a ComplexNumber class to represent a number is a number that's of the form a-+bi, where a and b are real numbers
Explanation / Answer
As per the chegg policy, please post one question per post.
I have answered Q1.
Please repsot others in separate post.
Output:
Number in room: 1, Total number: 1
Number in room: 3, Total number: 3
Number in room: 0, Total number: 3
Number in room: 1, Total number: 4
Please DONT forgot to rate my answer. We are working hard for you Guys!!