Draw a flowchart. do not output the number of minutes during which the service is used.
a. regularBill: This method calculates and returns the billing amount for regular
service.
b. premiumBill: This method calculates and returns the billing amount for premium
service.
Draw a flowchart of cellphone that uses the following methods to calculate the billing amount. do not output the number of minutes during which the service is used.
a. regularBill: This method calculates and returns the billing amount for regular
service.
b. premiumBill: This method calculates and returns the billing amount for premium
service.
Draw a flowchart of the smallestIndex, which takes as its parameters an int array and its size and returns the index of the (first occurrence of the) smallest element in the array.
Using a switch statement, write a program that prompts the user for a numeric code and two operands. The numeric codes of 1, 2, 3, and 4 represents addition, subtraction, multiplication, and division respectively. Before division, your program should check whether the second operand is not zero. If it is, it should display “Division by zero not allowed” to the screen.
Context
The Observer Pattern de nes a one-to-many dependency between objects so that when one object changes state, all of its dependents are noti ed and updated automatically.
Imagine the life of a celebrity who has many fans. Each of these fans wants to be know of what their favorite celebrity has posted recently (images, videos, chats, etc.). So as long as the fan’s interest continues, she/he can follow this celebrity. When the fan loses interest, she/he stops following that celebrity.
Hint: ∼ Fans are observers and celebrity is a subject.
∼ Remember, a celebrity can have more than one follower
a. Create an abstract class called GeometricFigure. Each figure includes a height, a width, a figure type, and an area. Include an abstract method to determine the area of the figure. Create two subclasses called Square and Triangle. Create an application that demonstrates creating objects of both subclasses, and store them in an array. Save the files as GeometricFigure.java, Square.java, Triangle.java, and UseGeometric.java.
b. Modify Exercise a, adding an interface called SidedObject that contains a method called displaySides(); this method displays the number of sides the object possesses. Modify the GeometricFigure subclasses to include the use of the interface to display the number of sides of the figure. Create an application that demonstrates the use of both subclasses. Save the files as GeometricFigure2.java, Square2.java, Triangle2.java, SidedObject.java, and UseGeometric2.java.
create a java program for Two Way Chat Application using Java Socket Programming