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
Systems management involves allocation of computer resources to keep all processes operating smoothly and at maximum efficiency.
olchik [2.2K]

Answer:operating system (OS), program that manages a computer's resources, especially the allocation of those resources among other programs. Typical resources include the central processing unit (CPU), computer memory, file storage, input/output (I/O) devices, and network connections.

Explanation:

8 0
3 years ago
Suppose that you want to write a program that inputs customer data including name, zipCode, balance, and regionNum. At the end o
Sergio039 [100]

The most likely statement during the main processing loop would be

customerCount[regionNum] =

customerCount[regionNum] + 1

<h3>What is a processing loop?</h3>

A loop means a sequence of instruction s that is continually repeated until a certain condition is reached.

In this case, the most likely statement during the main processing loop would be customerCount[regionNum] = and customerCount[regionNum] + 1.

Learn more about loop on:

brainly.com/question/4510147

#SPJ12

4 0
2 years ago
Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targe
natali 33 [55]

Answer:

The C++ code is given below with appropriate comments

Explanation:

//Remove this header file if not using visual studio.

#include "stdafx.h"

//Include the required header files.

#include <iostream>

//Use for maths function.

#include <cmath>

using namespace std;

//Define main function

int main()

{

      // Define the variables

      double targetValue = 0.3333;

      double sensorReading = 0.0;

      //Perform the opeartion.

      sensorReading = 1.0 / 3.0;

      // Get the absolute floating point value and

      // Check up to 4 digits.

      if (fabs(sensorReading - targetValue) < 1E-4)

      {

             //Print equal if the values are close enough.

             cout << "Equal" << endl;

      }

      else

      {

             //Print not equal if the values are not                  

             //close enough.

             cout << "Not equal" << endl;

      }

      system("pause");

      //Return the value 0.

      return 0;

}

5 0
3 years ago
What determines whether you can run two programs at the same time or connect your computer to a network?
GuDViN [60]
How your computer is built. Processor... Wireless card.... network card... ethernet ports...
4 0
4 years ago
Many interpretations of Hamlet exist, from long to short, from serious to humorous, and each calls attention to different aspect
madam [21]

Answer:

This video presents only the most important points in the plot:

the appearance of Hamlet's father's ghost

Claudius's efforts to determine the cause of Hamlet's strange behavior

Hamlet's soliloquy

Hamlet's rudeness to Ophelia, which leaves her heart-broken

the staging of the play, after which Hamlet is certain of Claudius's guilt

the scene in which Hamlet loses an opportunity to kill Claudius

the scene in which Hamlet rebukes his mother and then accidentally kills Polonius

Claudius's plan to kill Hamlet, which he shares with Laertes

the scene in the graveyard, in which Hamlet holds Yorick's skull

the scuffle between Laertes and Hamlet when Ophelia is buried

the duel between Laertes and Hamlet, followed by Gertrude's death, Hamlet's killing of Claudius, and Hamlet's death

The quick succession of events in this video seems to suggest that the sequence of events in the play is rather unlikely.

The major themes of the play, such as appearance versus reality, moral corruption, the complexity of action, and the mystery of death are not evident in this adaptation. Other important aspects of the play that the video does not address are the question of Hamlet's madness, his internal conflict, and his inaction. The video ignores characterization in Hamlet and the treatment of philosophical ideas throughout the play.

PLATO answer

Explanation:

PLATO said so

6 0
4 years ago
Other questions:
  • The figure above shows two pith balls suspended by threads from a support. In the figure, A. the pith balls are uncharged. B. pi
    13·2 answers
  • How to find something in the cloud?
    8·1 answer
  • The worst "review platform" (e.g. TripAdvisor, Zomato, Yelp) that can't be trusted?
    14·1 answer
  • Community gardens are public gardens where local residents can grow plants in a plot. They are very popular, so there are often
    7·1 answer
  • Dennis would like to include a video in a presentation. The source of the video is on the internet, but he would like to ensure
    10·2 answers
  • 90 points can someone please write the code for this (HTML):
    13·1 answer
  • Moving your Sprite top to bottom is moving along the X coordinate?<br><br> True<br> False
    5·2 answers
  • Write the output of the following program:
    8·1 answer
  • Any song recommendations, pls dont say 6ix9ine or lil pump
    5·2 answers
  • What is draft pls help me​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!