Question: Task #1 Write a program that has several desired functionalities (10pts) 1. Create a Shape.java Abstract class and the other classes as Concurrent classes, as

 Task #1 Write a program that has several desired functionalities (10pts)

1. Create a Shape.java Abstract class and the other classes as Concurrent

classes, as shown in the following example UML figure. Other classes, suchas Rectangle, extends Abstract Shape class. > Shape Driver > Circle |

Task #1 Write a program that has several desired functionalities (10pts) 1. Create a Shape.java Abstract class and the other classes as Concurrent classes, as shown in the following example UML figure. Other classes, such as Rectangle, extends Abstract Shape class. > Shape Driver > Circle | - radius double Circle Sering) toString computerea double compte Perimeter double readShapeData void ShapeOver maintavo Java Glass > Rt Triangle base double height: double Triangle(String toString String computerea double computePerimeter double readShapeDat void name: String Shape(String getShapellame String String String | o'compahaina) tute d computer met double readShapeatad vold 2. Implementation of two classes is in your textbook, and detailed information about the methods is also there. Implement the rest of the classes. However, you should implement in a way that the user enters the required parameters to program so that the required area, etc. calculated according to the selected shape type. In Shape abstract class, all methods are abstract except the getShapeName method. You need to implement abstract methods in the concurrent classes. All attributes are private. 3. readShapeData() method in each class gets the required input/inputs from a user by handling exception cases. 4. Create a driver class called Shape Driver, which is a concurrent class. You need to implement it in a way that it can do the operation in the correct shape according to user selection. For example, the flow of how Shape Driver work can be as follows: EX: When I run ShapeDriver, It will ask me the shape name as follow: EX: When I run ShapeDriver, It will ask me the shape name as follow: Please enter the shape name: After I write rec, it will call the Rectangle class, and Rectangle class asks me to enter the width and height in a double format as follows: Please enter width and height: Assume I enter 4.5 5.6; it will calculate the perimeter and area and print out the information as follows: Rectangle width: 4.5, height: 5.6, perimeter: 20.2, area: 25.2 However, if I enter the wrong information, type, any non-logical inputs, Shape Driver should provide enough information about what I am doing wrong and handle all cases. Then, Shape Driver should request from me to enter the shape name and continue. You have to catch the error if there is. Your program should not terminate until I write *** for shape name. Think about if I enter such a big number, negative number, and different formats such as strings to handle. Similar to Rectangle, if I enter cir, it will call Circle class, if I enter rtTri, it will call RtTriangle (Right Triangle), and if I enter tri, it will call Triangle class to get required parameters from the user and show the results. If I enter *** for shape name, the program should be terminated. Please think carefully while you are developing your program and under which conditions the given parameters satisfy the shape requirements (Triangle inequality). Task #2 Write the Program for logical operations (10 pts) 1. You need to implement a program that will do some Boolean operations. You need to create two classes. One class is BooleanOperationDriver, which has the main method, and the other class is BooleanOperation, which has four static methods, as shown in the following figure. The driver class will call the correct static methods from BooleanOperation while reading each line from operations.txt file. Make sure that you are handling the line which cannot have correct input by giving a warning and skipping that line, and continue to read the next line > BooleanOperation > BooleanOperationDriver BooleanOperation BooleanOperationDriver not(String): String o main(Stringvoid of xor(String String): String Sand(String, String): String or(String, String): String 2. You need to open the file operations.txt file (The file is on the blackboard.). According to given commands such as "OR", "AND", "XOR", "NEGATE", with "FALSE" and "TRUE", you need to produce the correct output and write each operation with their results another file which is called operationsResult.txt. The following explanations give when true or false occurs for different Boolean operations. (Think 1 as true and 0 as false.) i if z is 0 NOT(x) To if x is 1 The and, or, and exclusive or functions are familiar boolean functions of two variables. 11 if both x and y are 1 AND(x,y) lo otherwise OR(x, y) (1 if either x or y (or both) is 1 0 otherwise XOR(x,y) = {. 1 if u and y are different lo otherwise Task #1 Write a program that has several desired functionalities (10pts) 1. Create a Shape.java Abstract class and the other classes as Concurrent classes, as shown in the following example UML figure. Other classes, such as Rectangle, extends Abstract Shape class. > Shape Driver > Circle | - radius double Circle Sering) toString computerea double compte Perimeter double readShapeData void ShapeOver maintavo Java Glass > Rt Triangle base double height: double Triangle(String toString String computerea double computePerimeter double readShapeDat void name: String Shape(String getShapellame String String String | o'compahaina) tute d computer met double readShapeatad vold 2. Implementation of two classes is in your textbook, and detailed information about the methods is also there. Implement the rest of the classes. However, you should implement in a way that the user enters the required parameters to program so that the required area, etc. calculated according to the selected shape type. In Shape abstract class, all methods are abstract except the getShapeName method. You need to implement abstract methods in the concurrent classes. All attributes are private. 3. readShapeData() method in each class gets the required input/inputs from a user by handling exception cases. 4. Create a driver class called Shape Driver, which is a concurrent class. You need to implement it in a way that it can do the operation in the correct shape according to user selection. For example, the flow of how Shape Driver work can be as follows: EX: When I run ShapeDriver, It will ask me the shape name as follow: EX: When I run ShapeDriver, It will ask me the shape name as follow: Please enter the shape name: After I write rec, it will call the Rectangle class, and Rectangle class asks me to enter the width and height in a double format as follows: Please enter width and height: Assume I enter 4.5 5.6; it will calculate the perimeter and area and print out the information as follows: Rectangle width: 4.5, height: 5.6, perimeter: 20.2, area: 25.2 However, if I enter the wrong information, type, any non-logical inputs, Shape Driver should provide enough information about what I am doing wrong and handle all cases. Then, Shape Driver should request from me to enter the shape name and continue. You have to catch the error if there is. Your program should not terminate until I write *** for shape name. Think about if I enter such a big number, negative number, and different formats such as strings to handle. Similar to Rectangle, if I enter cir, it will call Circle class, if I enter rtTri, it will call RtTriangle (Right Triangle), and if I enter tri, it will call Triangle class to get required parameters from the user and show the results. If I enter *** for shape name, the program should be terminated. Please think carefully while you are developing your program and under which conditions the given parameters satisfy the shape requirements (Triangle inequality). Task #2 Write the Program for logical operations (10 pts) 1. You need to implement a program that will do some Boolean operations. You need to create two classes. One class is BooleanOperationDriver, which has the main method, and the other class is BooleanOperation, which has four static methods, as shown in the following figure. The driver class will call the correct static methods from BooleanOperation while reading each line from operations.txt file. Make sure that you are handling the line which cannot have correct input by giving a warning and skipping that line, and continue to read the next line > BooleanOperation > BooleanOperationDriver BooleanOperation BooleanOperationDriver not(String): String o main(Stringvoid of xor(String String): String Sand(String, String): String or(String, String): String 2. You need to open the file operations.txt file (The file is on the blackboard.). According to given commands such as "OR", "AND", "XOR", "NEGATE", with "FALSE" and "TRUE", you need to produce the correct output and write each operation with their results another file which is called operationsResult.txt. The following explanations give when true or false occurs for different Boolean operations. (Think 1 as true and 0 as false.) i if z is 0 NOT(x) To if x is 1 The and, or, and exclusive or functions are familiar boolean functions of two variables. 11 if both x and y are 1 AND(x,y) lo otherwise OR(x, y) (1 if either x or y (or both) is 1 0 otherwise XOR(x,y) = {. 1 if u and y are different lo otherwise

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!