Complete 9.6 and 9.11. Draw the UML diagrams for both programs. A free program to create diagrams using your browser is athttps://www.draw.io/ Grading Criteria ================ 9.6 Stopwatch 0.25...

1 answer below »

Complete 9.6 and 9.11. Draw the UML diagrams for both programs. A free program to create diagrams using your browser is athttps://www.draw.io/


Grading Criteria


================


9.6 Stopwatch


0.25 Declare and initialize fields
0.25 getters for fields
0.5 constructors
0.5 start() and stop() method
0.5 getElapsedTime()
1.0 Draw UML
1.0 Documentation



9.11 2x2 linear equations


0.25 Declare fields
0.25 constructor
0.5 getters for fields
0.5 method isSolvable()


0.5 method getX() and getY()


1.0 Draw UML
1.0 Documentation

Answered Same DayAug 31, 2021

Answer To: Complete 9.6 and 9.11. Draw the UML diagrams for both programs. A free program to create diagrams...

Neha answered on Sep 02 2021
136 Votes
43915/Documentation.docx
Student Id:
Student Name:
2 X 2 Linear Equations
A 2X2 linear equation is a set of two equations with same variables. Generally, there ar
e two equations and two variables. A system can be designed for these equations to get values of the variables.
I have written a java code to solve this problem. In this program I have declared one main class and three methods in it to solve the equation. isSolvable, getX and getY are the methods. As the program starts compiler reads main class. User will be able to see the format of the equation which we are following in this code.
Ax + By = E
Cx + Dy = F
The user will be asked to enter values for A, B, C, D, E and F. Cross multiplication is used to calculate values. Once he enters these values, we will calculate them to get number1, number2 and denominator value.
Number1 = ((E * D) - (B * F));
Number2 = ((A * F) - (E * C));
Denominator = ((A * D) - (B * C));
The program will check the value of denominator. If it is equal to 0 then equation can’t be solved and program will exit because any number can’t be divided by 0. If denominator is either greater than 0 or less than 0 then it will calculate the value of X and Y.
X = Number1 / Denominator
Y = Number2 / Denominator
Program will print the value of X and Y and it will exit.
Source Code
import java.util.Scanner;
public class Main
{
public static void main (String[]args)
{
// declare variables to store values of eqaution
double a, b, c, d, e, f, number1, number2, denom;
// create Scanner to read user input
Scanner input = new Scanner (System.in);
System.out.print ("This...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here