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
Advocard [28]
2 years ago
6

Input 3 positive integers from the terminal, determine if tlrey are valid sides of a triangle. If the sides do form a valid tria

ngle, output the type of triangle - equilateral, isosceles, or scalene - and the area of the triangle. If the three integers are not the valid sides of a triangle, output an appropriats message and the 3 sides. Be sure to comment and error check in your progam.
Computers and Technology
1 answer:
butalik [34]2 years ago
4 0

Answer:

In Python:

side1 = float(input("Side 1: "))

side2 = float(input("Side 2: "))

side3 = float(input("Side 3: "))

if side1>0 and side2>0 and side3>0:

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

       if side1 == side2 == side3:

           print("Equilateral Triangle")

       elif side1 == side2 or side1 == side3 or side2 == side3:

           print("Isosceles Triangle")

       else:

           print("Scalene Triangle")

   else:

       print("Invalid Triangle")

else:

   print("Invalid Triangle")

Explanation:

The next three lines get the input of the sides of the triangle

<em>side1 = float(input("Side 1: ")) </em>

<em>side2 = float(input("Side 2: ")) </em>

<em>side3 = float(input("Side 3: ")) </em>

If all sides are positive

if side1>0 and side2>0 and side3>0:

Check if the sides are valid using the following condition

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

Check if the triangle is equilateral

<em>        if side1 == side2 == side3: </em>

<em>            print("Equilateral Triangle") </em>

Check if the triangle is isosceles

<em>        elif side1 == side2 or side1 == side3 or side2 == side3: </em>

<em>            print("Isosceles Triangle") </em>

Otherwise, it is scalene

<em>        else: </em>

<em>            print("Scalene Triangle") </em>

Print invalid, if the sides do not make a valid triangle

<em>    else: </em>

<em>        print("Invalid Triangle") </em>

Print invalid, if the any of the sides are negative

<em>else: </em>

<em>    print("Invalid Triangle")</em>

You might be interested in
Write a program in Java programming language to display or calculate “Hello, Daddy and Mum”
olganol [36]

Answer:

class Simple{

public static void main(String args[]){

System.out.println("Hello Daddy and Mum);

}

}

Explanation:

First, we create a class, then a method and then give the Integrated Data Environment (IDE) the command to give out an output that says Hello, Daddy and Mum”

8 0
2 years ago
What is the connection between sites that allows for intersite replication called? (Points : 5) Bridgehead server
Travka [436]

Answer: Site Link

Explanation: Site link is the type connection that is created for the different sites.It helps in the connectivity in the multiple site surrounding known as inter-site and transferring the traffic created by the replication activity.

Other options are incorrect because bridgehead servers is a device to control the domain,subnet is the part of the IP network and domain is used for the identification of address .Thus, the correct option is site link.

4 0
3 years ago
Write a program that inputs an integer denoting a month (1 for January, 2 for February, ... , 12 for December), and outputs how
Korolek [52]

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int inp_month;

cout<<"Enter month:";

// read month

cin>>inp_month;

// if month is february

if(inp_month==2)

cout<<"Number of days in month:28"<<endl;

// if month is 4 or 6 or 9 or 11

else if(inp_month==4||inp_month==6||inp_month==9||inp_month==11)

cout<<"Number of days in month:30"<<endl;

else

// for others month

cout<<"Number of days in month:31"<<endl;

return 0;

}

Explanation:

Read month from user and assign it to variable "inp_month".If month is 2 then  there is 28 days in the month.If input month is 4 or 6 or 9 or 11 then there is 30 days in the month.For other month there will be 31 days in month.We assume there is no leap year.

Output:

Enter month:4                                                                                                              

Number of days in month:30

6 0
3 years ago
The use of public wireless connections can increase a user's vulnerability to monitoring and compromise. ____________ software c
GalinKa [24]

The use of public wireless connections can increase a user's vulnerability to monitoring and compromise. <u>VPN </u> software can be used to encrypt transmissions over public networks, making it more difficult for a user's PC to be penetrated.

Explanation:

  • A VPN, or Virtual Private Network, allows you to create a secure connection to another network over the Internet.
  • VPNs can be used to access region-restricted websites, shield your browsing activity from prying eyes on public Wi-Fi, and more. .
  • Virtual Private Network, is a private network that encrypts and transmits data while it travels from one place to another on the internet. VPNs aren't just for desktops or laptops, you can set up a VPN on your iPhone, iPad or Android phone.
  • A VPN encrypts the traffic from your machine to the exit point of the VPN network. A VPN isn't therefore likely to protect you from an adversary like Anonymous.
  • VPNs add another layer of encryption to your internet traffic, your latency will go up and speeds will go down.

3 0
3 years ago
Specification of database requirements falls under which category of database​ administration?
enot [183]
Specification of database requirements falls under which category of database​ administration?

b. development
3 0
3 years ago
Other questions:
  • When an object is selected, it is surrounded by ________, which allow you to change the size of the object.?
    5·1 answer
  • Convert the following pseudi code to C++ code. BE sure to define the apprpriat evariables.
    9·1 answer
  • The expression that is tested by a switch statement must have a(n) __________ value.
    12·1 answer
  • Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n
    6·1 answer
  • Convert the following pseudocode to C++ code. Be sure to define the appropriate variables. Store 25 in the speed variable. Store
    5·1 answer
  • What does lurch mean
    14·2 answers
  • Write a Java program to count the characters in each word in a given sentence?Examples:Input : geeks for geeksOutput :geeks-&gt;
    10·1 answer
  • Which act requires that financial institutions must provide a privacy notice to each consumer that explains what data about the
    12·1 answer
  • In 2-5 paragraphs, describe how you would create a new database using your software.
    9·1 answer
  • Write the use of these computers.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!