Answered step by step
Verified Expert Solution
Link Copied!

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.

  1. Tells the user what the program does.
  2. Prompts the user to enter the values for the sides, color, and filled attribute for a triangle object.
  3. Saves the users input.
  4. Using the values entered by the user, creates the Triangle object.
  5. 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.
  6. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions