Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
- 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 itstoString( ) 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started