A. Modify this code so it will determine whether or not input sides compose a right...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A. Modify this code so it will determine whether or not input sides compose a right triangle: Determine whether or not three input sides compose a right triangle. # Request the inputs side1= int(input("Enter the first side: ")) side2 = int(input("Enter the second side: ")) side3 = int(input("Enter the third side: ")) # Compute the squares square1 = side1 ** 2 square2 = side2 ** 2 # Determine the result and display it if square1 + square2 square3 or \ square2 + square3 square1 or \ square1 + square == square2: print("The triangle is a right triangle.") print("The triangle is not a right triangle.") else: == == A. Modify this code so it will determine whether or not input sides compose a right triangle: Determine whether or not three input sides compose a right triangle. # Request the inputs side1= int(input("Enter the first side: ")) side2 = int(input("Enter the second side: ")) side3 = int(input("Enter the third side: ")) # Compute the squares square1 = side1 ** 2 square2 = side2 ** 2 # Determine the result and display it if square1 + square2 square3 or \ square2 + square3 square1 or \ square1 + square == square2: print("The triangle is a right triangle.") print("The triangle is not a right triangle.") else: == ==
Expert Answer:
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
In June of 2014, Bill Madden considered expanding his micro tiles business. He planned to invest $2.0 million in 2016 to produce more and better quality plaster or metal tiles and lithographs. These...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Derive the transfer function of the circuit shown in figure below (for an ideal op amp) and show that it can be written in the form - V. -R2/R1 V," [1+ ( +j) Where w1 = 1/C,R1 and w2 = 1/ C2R2....
-
Explain why the discount rate equals the opportunity cost of capital.
-
Values of modulus of elasticity (MOE, the ratio of stress, i.e., force per unit area, to strain, i.e., deformation per unit length, in GPa) and flexural strength (a measure of the ability to resist...
-
What do you mean by normal stress and shear stress?
-
Precision Manufacturing Inc. (PMI) makes two types of industrial component parts-the EX300 and the TX500. It annually produces 60,000 units of EX300 and 12,500 units of TX500. The company's...
-
Study Problem 9-8 (algo) Table A below shows abbreviated balance sheets for the central bank in the country of Beckland and B shows tables for its whole" commercial banking system. The target reserve...
-
Consider a hospital in which each doctor is responsible for many patients while each patient is cared for by just one doctor. Each doctor has a unique employee number, name, telephone number, and...
-
3. Answer the following questions regarding diversification: What is the diversification principle? b. Explain why diversifying between assets with low or no correlation reduce overall risk? c. What...
-
Fruta manufactures industrial water tanks. The following data are for October 2006. The company had 5 units in beginning inventory. In October, 35 units were produced, and 20 were sold. The average...
-
A freelance artist is paid $3,920 for a contracted job. The money is invested in a savings account earning 3.05% annual interest compounded monthly. What is the total account balance after 6 months?
-
Zoey contributed land with a tax basis of $45,000 and a fair market value of $100,000 in exchange for a 20% percent interest in the newly formed ZAT Partnership. All other partners contributed cash...
-
Write java IF statement that prints true if both x and y are positive numbers. 3. If integer variable currentNumber is odd, change its value so that it is now 3 times currentNumber plus 1, otherwise...
-
2. German and Elena were residents of Puerto Rico in 2022. They are age 72 and file a joint return. German is retired from the U.S. Postal Service and Elena is retired from the U.S. Veterans Affairs....
-
#ifndef PackageTracking_h #define PackageTracking_h #pragma once #include #include #include #include #include #include #include "ShippingStatus.h" using namespace std; class PackageTracking { public:...
-
(a) What is the focal length of a magnifying glass that gives an angular magnification of 8.0 when the image is at infinity? (b) How far must the object be from the lens?
-
Listing 5.15 determines whether a number n is prime by checking whether 2, 3, 4, 5, 6, ..., n/2 is a divisor. If a divisor is found, n is not prime. A more efficient approach is to check whether any...
-
The U.S. Census Bureau projects population based on the following assumptions: One birth every 7 seconds One death every 13 seconds One new immigrant every 45 seconds Write a program to display...
-
Write a program that displays a random uppercase letter using the Math.random() method.
-
Why are ores so valuable? (a) They are sources of naturally occurring gold. (b) Metals can be efficiently extracted from them. (c) They tend to occur in scenic mountainous regions. (d) They hold many...
-
Aluminum ions carry a 3+ charge, and chloride ions carry a 1- charge. What is the chemical formula for the ionic compound aluminum chloride? (a) Al 3 Cl (b) AlCl 3 (c) Al 3 Cl 3 (d) AlCl
-
An atom loses an electron to another atom. Is this an example of a physical or chemical change? (a) chemical change involving the formation of ions (b) physical change involving the formation of ions...
Study smarter with the SolutionInn App