The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 6 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
PLEASE HELP THANK YOU
Â
Triangle equal = new Triangle (6, 6, 6); //example of equilateral (and isosceles) triangle
Triangle isosceles = new Triangle (3, 7, 7); // example of isosceles triangle
Triangle scalene = new Triangle (4, 5, 6); // example of scalene triangle
4 4 4 triangle: It is isosceles
It is equilateral It is not scalene
Check another Triangle (y/n)? y Enter the sides of the triangle: 377
3 7 7 triangle:
It is isosceles
It is not a equilateral It is not scalene
Check another Triangle (y/n)? n Press any key to continue . . .
Submission
• Go to the course web site (my.asu.edu), and then click on the on-line Submission tab.
• Submit your Assignment4.java file on-line. Make sure to choose Hw4 from drop-down box. • Assignment4.java should have the following, in order:
- In comments, the assignment header.
- The working Java code requested in Part #2.
- The Assignment4.java file must compile and run as you submit it. You can confirm this by viewing your submission results.
Important Note: You may resubmit as many times as you like until the deadline, but we will only mark your last submission.
Â
Driver:
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
// AUTHOR: your name
// FILENAME: title of the source file
// SPECIFICATION: description of the program
// TIME SPENT: how long it took you to complete the assignment
//----------------------------------------------------------------------*/
import java.util.Scanner;
public class Assignment4
{
//===========================================================
// Create and determine properties of various triangles.
//===========================================================
public static void main (String[] args)
{
Scanner console = new Scanner(System.in);
int num1, num2, num3;
String another;
// repeat until the user enter 'n'
do
{
// get the input
System.out.println("Enter the sides of the triangle: ");
num1 = console.nextInt();
num2 = console.nextInt();
num3 = console.nextInt();
// create the Triangle
Triangle myTriangle = new Triangle (num1, num2, num3);
// print the Triangle
System.out.println(myTriangle.toString() + " triangle:");
//check the isosceles
if (myTriangle.is_isosceles())
System.out.println("tIt is isosceles");
else
System.out.println("tIt is not isosceles");
//check the equilateral
if (myTriangle.is_equilateral())
System.out.println("tIt is equilateral");
else
System.out.println("tIt is not a equilateral");
//check the scalene
if (myTriangle.is_scalene())
System.out.println("tIt is scalene");
else
System.out.println("tIt is not scalene");
// find if the user want to repeat
System.out.println();
System.out.print("Check another Triangle (y/n)? ");
another = console.next();
} while (another.equalsIgnoreCase("y"));
} // method main
} // class Assignment4
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly