Tells the user what the program does. Prompts the user to enter the values for the sides,
Fantastic news! We've Found the answer you've been seeking!
Question:
- Tells the user what the program does.
- Prompts the user to enter the values for the sides, color, and filled attribute for a triangle object.
- Saves the users input.
- Using the values entered by the user, creates the Triangle object.
- Displays the string representation of the Triangle object by calling its toString( ) method. Look at the output example below to see what this output should look like.
- Displays a goodbye message.
The example below show what your program should look like when it runs (user input is in green).
This program gets input for a triangle from the user.
It then creates a Triangle object and displays its description.
Enter the color of the triangle (e.g. "red"):
red
Is the triangle filled (y or n):
y
Enter the non-zero, positive lengths of the three sides of the triangle:
3 4 5
Triangle Output:
side1 = 3.0, side2 = 4.0, side 3 = 5.0
created on Wed May 22 07:34:11 MDT 2019
color: red and filled = true
Area = 6.00
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Posted Date: