Find out if they can be formed into a triangle

Assignment Help Computer Engineering
Reference no: EM1332349

The sum of the lengths of any two sides of a triangle must be greater than the length of the third side. For example, the numbers 3, 4, and 5 can form a triangle because 3+4 > 5, 4+5 > 3, and 5+3 > 4. In contrast, the numbers 1, 2, and 5 cannot form a triangle because 1+2 < 5. Thus, if you are given any three integers, you can determine whether they could possibly form a triangle or not by applying this general principle.

Write a JavaScript program that allows a user to input three integers using text boxes in a form. (Hint: You need to use the built-in parseInt function to convert the input strings to integers.) Test the three integers to determine if they can be formed into a triangle using the rule given above. Also test if the resulting triangle would be a right triangle using the Pythagorean theorem, namely that the square of the hypotenuse (the longest side) equals the sum of squares of the other two sides. Display an alert box to inform the user whether their integers can form a triangle or a right triangle (tell them which), or if the integers cannot form a triangle. Continue accepting sets of three integers and testing them until the user decides to quit.

Reference no: EM1332349

Questions Cloud

Make a web page that contains two selection lists : Pick your favorite sport and search the internet for current roster of players for five teams. design a web page that contains two selection lists: one that displays a drop-down menu of team names and the other a multi-line selection list that dis..
Bond calculations-discount-premium : Find out the total discount or premium for each issue. Find out the annual amount of discount or premium amortized for each bond.
Customs to become part of their host nation : To what extent do you think that immigrant families should give up their customs to become part of their host Nation.
Stakeholder analysis and management strategy : Your stakeholders based on their level of authority (power) and their level of concern (interest) regarding the outcome of your project in a Power/Interest Grid.
Find out if they can be formed into a triangle : Write down a JavaScript program that allows a user to input three integers using text boxes in a form. (Hint: You need to use the built-in parseInt function to convert the input strings to integers.) Test the three integers to determine if they ca..
What roles should hr professionals play : What roles should HR professionals play in staffing decisions and How should we determine who should be involved?
Solving transportation and assignment problems : Explain the 4 major methods used when solving transportation and assignment problems.
Describe the core principle of the standard : Describe the core principle of the standard and whether or not you are in agreement with the proposed standard.
Explain organizational development and training program : Prepare a detailed report of what your recommendations would be for the call center and Components of your job analysis and design

Reviews

Write a Review

Computer Engineering Questions & Answers

  Make a binary tree using an underlying linked-list approach

Write down a C++ program to build a binary tree using an underlying linked-list approach. Include capability to traverse the tree and print out the nodes in a format which makes it readily clear how the tree is organized.

  Express and give an example of a web database.

Explain the difference between system design and system analysis.

  Explain a mitigating strategy for the risks

Briefly identify and describe a mitigating strategy for the risks.

  Explain working procedure for karnaugh map

describe working procedure for Karnaugh map or K-map for two-, three- and four-variable functions.

  Aspects of effectiveness and robustness in software

Aspects of effectiveness and robustness in software

  What is joptionpane class or the scanner class

What is JOptionPane class or the Scanner class

  What frustrations with computer capabilities today

What frustrations do you have with computer capabilities today.

  How to write a program that allows the user to enter student

how to Write a program that allows the user to enter student names followed by their test scores and output the following information.

  Select which currency they wish to display

Expand the "Currency Conversion" program to have a menu of five currencies that allows the user to choose which currency they wish to show in its equivalency to the US dollars.

  Algorithm for finding two closest numbers in the input list

plan an algorithm for finding two closest numbers in the input list. What is the time complexity? Is it possible to improve the algorithm if the input is a sorted list.

  Ssl protection

Explain whether pages are served over the SSL protected from problem you explained. If so, explain why; if not, explain why not.

  Explain the action of the function

Describer the action of the function. What is the function in the library that performs a similar calculation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd