Exercise 2:
Draw a State machine Diagram for a Telephone line (a process in a smartphone OS) with the following behavior:
When the telephone app is not active, the telephone line is idle. When the app is activated, the line gives a dial tone and can accept the dialing of digits.
If after getting the dial tone, the user doesn't dial a number within a time interval of 10 seconds, then a time-out occurs, and the line gets idle again. A button on the app can re- activate the line.
After dialing a number, if the number is invalid then a recorded message is played at the end of which the line becomes idle.
Upon entry of a valid number, the phone app tries to connect a call & routes it to the proper destination.
If the called person answers the phone, the conversation can occur, and the line is in an on- call state. When the called person hangs up, the phone app disconnects and the line goes to the idle state.
Step by stepSolved in 3 steps with 1 images
- i need the answer quicklyarrow_forwardDraw the UML diagram for the class. Implement the class. Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the balance, the monthly interest, and the date when this account was created.arrow_forwardHi, this is a java programming question with direction of what to do. I'm just gonna attach the question sheet. Implement the following class diagram (diagram in attached photo)setFirstName() method should set the firstName attribute of the class.setLastName() method should set the lastName attribute of the class.setSpecialization() method should set the specialization attribute of the Doctor class.setHealthnumber() method should set the healthNumber attribute of the Patient class.setIllness() method should set the illness attribute of the Patient class.If you are not comfortable with set methods, you are free to create your own constructors to set the attribute values.Create a HospitalApplication class which contains the main method. Inside the main method the following should be done in the order mentioned. (Any other ordering would not guarantee full marks).Prompt for the following inputs for 5 Doctors. (Use for loops)• First name• Last name• SpecializationValid specializations…arrow_forward
- 1) Implement a class Moth that models a moth flying along a straight line. The moth hasa position, which is the distance from a fixed origin. When the moth moves toward apoint of light, its new position is halfway between its old position and the position ofthe light source. Find the instance variable(s), define and implement the constructor(s), then supplythe following methods:- public void moveToLight(double lightPosition) - public double getPosition()2) Document your class, generate Javadoc documentation and produce a test program ‘MothTester’that construct a moth, move it toward a couple of light sources, and check that the moth’s positionis as expected. 3) Add a comment to your class Moth that explains how you can make the Moth immobile after 10moves.arrow_forwardDesign a class hierarchy for a simple banking system. Include classes for a Bank, Account, and Customer. Implement methods for depositing and withdrawing money, transferring funds between accounts, and checking the account balance.arrow_forwardCreate a java program with a class whose instances represent a single playing card from a deck of cards. Playing cards have two distinguishing properties: rank and suit.arrow_forward
- Create a UML class diagram of the application illustrating class hierarchy, collaboration, and the content of each class. There is only one class. There is a main method that calls four methods. I am not sure if I made the UML Class diagram correct. import java.util.Random; // import Random packageimport java.util.Scanner; // import Scanner Package public class SortArray{ // class name public static void main(String[] args) { //main method Scanner scanner = new Scanner(System.in); // creates object of the Scanner classint[] array = initializeArray(scanner); System.out.print("Array of randomly generated values: ");displayArray(array); // Prints unsorted array sortDescending(array); // sort the array in descending orderSystem.out.print("Values in desending order: ");displayArray(array); // prints the sorted array, should be in descending ordersortAscending(array); // sort the array in ascending orderSystem.out.print("Values in asending order: ");displayArray(array); // prints the…arrow_forwardDesign and implement the class Day that implements the day of the week in a program. The program should be able to perform the following operations on an object of the type Day: Set the day. Print the day. Return the day. Return the next day. Return the previous day. Add a comment with your full name in it in any part of the program.arrow_forwardJava Question - Instructions are in the attached pictures. The picture titled "Screenshot..." are the instructions for building the specific code, while the "Final Output" picture shows what the output of the code should look like. Please make sure no errors show up in the Java compiler. Thank you.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education