1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
-Dominant- [34]
3 years ago
5

Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a co

lor, and a Boolean value to indicate whether the triangle is filled.
Computers and Technology
1 answer:
Ivanshal [37]3 years ago
7 0

Answer:

   Scanner in = new Scanner(System.in);

       System.out.print("Please enter 3 sides of a triangle, color and " +

                       "whether it is filled or not (true false): ");

       double s1 = in.nextDouble();

       double s2 = in.nextDouble();

       double s3 = in.nextDouble();

       String color = in.next();

       boolean filled = in.nextBoolean();

       

       Triangle t1 = null;

       

       try {

           t1 = new Triangle(s1, s2, s3, color, filled);

       }

       catch (IllegalTriangleException ite) {

           System.out.println(ite.toString());

       }

       

       System.out.println(t1.toString());

       System.out.printf("Triangle color: %s, Triangle filled: %s%n" +  

                       "Area: %.2f%n" +  

                       "Perimeter: %.2f%n%n",

                   t1.getColor(),  

                   t1.isFilled(),

                   t1.getArea(),

                   t1.getPerimeter());

           

Explanation:

   Scanner in = new Scanner(System.in);

       System.out.print("Please enter 3 sides of a triangle, color and " +

                       "whether it is filled or not (true false): ");

       double s1 = in.nextDouble();

       double s2 = in.nextDouble();

       double s3 = in.nextDouble();

       String color = in.next();

       boolean filled = in.nextBoolean();

       

       Triangle t1 = null;

       

       try {

           t1 = new Triangle(s1, s2, s3, color, filled);

       }

       catch (IllegalTriangleException ite) {

           System.out.println(ite.toString());

       }

       

       System.out.println(t1.toString());

       System.out.printf("Triangle color: %s, Triangle filled: %s%n" +  

                       "Area: %.2f%n" +  

                       "Perimeter: %.2f%n%n",

                   t1.getColor(),  

                   t1.isFilled(),

                   t1.getArea(),

                   t1.getPerimeter());

           

You might be interested in
Match the item to the type.​
Roman55 [17]
The chart with the circle in the top right is a pie chart

the top left chart on enrollment is a histogram

the bottom chart is a bar chart
3 0
2 years ago
Collaborative filtering is
vazorg [7]

Answer:

A: used by ISP's to filter out email SPAM

C: a way to help an individual focus on best choices when deciding what to watch or buy.

Explanation:

Collaborative filtering uses a community-based approach to filter spam. It works by collecting numerous email users from around the world. By doing this, it becomes possible for users to flag emails that are spam and those that are legitimate.

Also Collaborative Filtering is one of the most efficient techniques for building a system that can help a user when it comes to recommending best choices based on information from a large number of users.

4 0
3 years ago
Why are using some special characters (@, #, !, etc.) not a good idea?
konstantin123 [22]
There are pros and cons to using special characters in email subject lines. Generally, marketers report higher open rates.

Some report better engagement, but many don’t.

There are also reports of special characters causing problems with deliverability, mostly because spammers became very fond of special characters for a while.
5 0
3 years ago
Read 2 more answers
1. Bones do not change position when the muscles contract and release.
DochEvi [55]
TrueBones do not change position
6 0
3 years ago
Who still plays old Nintendo 64 games?
Lesechka [4]

Answer:

I play Nintendo 64 games when I was young. I use to love playing Mario 64 as well.

8 0
2 years ago
Read 2 more answers
Other questions:
  • Tornado Alley is located in the middle of the United States, extending from Texas up through the Dakotas. The above statement is
    14·1 answer
  • Store programming components in the shared folder. you want to secure the data in the folder as follows: members of the research
    11·1 answer
  • Mobile apps known as news _________ collect articles from a variety of sources and present them to you in a magazine-style forma
    7·2 answers
  • How do you know if your phone has a virus?
    13·1 answer
  • If a table is designed so that every determinant is a candidate key, then that relation is in ________.
    14·1 answer
  • A(n) ________ is a specific type of computer program that manages all programs on a computer.
    8·1 answer
  • • Open your Netbeans IDE and answer the following question
    5·1 answer
  • p25: File Write and Read1) User enters a file name (such as "myMovies.txt").2) User enters the titles of 4 of their favorite mov
    12·1 answer
  • How can the system administrator give the executive assistant the ability to view, edit, and transfer ownership of all records,
    6·1 answer
  • In 1972, earlier designers built the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!