Calculation of the hypotenuse

Assignment Help Software Engineering
Reference no: EM1378919

Question: Construct a C# console application that computes the hypotenuse of a right triangle. The computation of the hypotenuse of a right triangle is based on the Pythagorean Theorem: c2 = a2 + b2 and the hypotenuse, c ("long side") of the triangle can be computed with the formula the hypotenuse is equal to the square root of the side a squared plus side b squared.
The application should take as many side pairs inputs as the user desires and calculate each until the user enters a zero for both side one and side two (sentinel loop). You should use at least two (2) Math class methods.
The output should look something like this:
enter length of first side: 3

enter length of second side: 4

The hypotenuse is 5

enter length of first side: 3.44

enter length of second side: 4.88

The hypotenuse is 5.97059461025449

enter length of first side: 10.55

enter length of second side: 33.0

The hypotenuse is 34.6453820876607

enter length of first side: 0

enter length of second side: 0

Press any key to continue . . .
Note in the first example with the entries of 3 and 4 that the hypotenuse is computed as 5. If you are not getting that answer (The hypotenuse is 5) with entries of 3 and 4 respectively, then you are not taking the inputs and converting them correctly. Remember that a ReadLine brings in characters but there are differences in how the conversion methods for character and string values work. There is another way to convert a string number input to a numeric value type. You may have to do some research to come up with the right conversion method. Also note that type double values are used.
Name the .cs file Assignment_6_yourlastname and submit it to the link below.
Submit only the .cs file with your code in it.

Reference no: EM1378919

Questions Cloud

Effect of the time step on stability and accuracy : For each case of each method, plot the velocity profile for four difference times on the same graph - Write a code to solve this problem for the schemes and conditions.
Complete life cycle data management : MS Excel is one of the most comprehensive environments for the compilation and interpretation of information. With its information structuring, analysis, and graphing capabilities.
Example of a business related report : Recognize an example of a business related report created with MS Excel. Attach a sample of the report in an Microsoft Excel file.
Determine the output of the code sequenc : Determine the output of this code sequence? The user successively enters 3, 5, and -1.
Calculation of the hypotenuse : Construct a C# console application that calculate the hypotenuse of a right triangle. The calculation of the hypotenuse of a right triangle is based on the Pythagorean Theorem:
Element of array : Discuss how do you access the element of array a located at row two and column four?
Java questions : The linked list that given represents a stack. After we push the player onto the stack, what are first and last items on the stack?
Aspects of software development : Unit testing is the driving technology behind a software design method termed Test Driven Development, which, in turn, is a factor of the agile school of software development.
Element of object oriented systems : Several people view the four foundational factors of object-orientation as abstraction, encapsulation, inheritance, and polymorphism. There is a certain purity in being minimal.

Reviews

Write a Review

Software Engineering Questions & Answers

  Produce e-r diagram which documents entities

Produce an E-R diagram, which documents the entities and relationships involved in the Retail outlet of a Stationary Shop which includes sales, purchases and inventory of various stationary items etc.

  Create state diagram-handles login-security for application

You are designing module which handles login and security for application. Create state diagram which explains the above actions. Make sure that you name each state and include triggers which cause transitions as well as any conditions that may app..

  As it project manager take systems view of project

As an IT project manager, you may take a systems view of a project. What does it mean to take a systems view of a project?

  Draw an erd with cardinality notation

Review the Personal Trainer fact-finding summary and draw an ERD with cardinality notation. Assume that system entities include members, activities and services, and fitness instructors.

  Sketch environment diagram illustrating structure of pizza

Assume we evaluate following expressions: (define pizza (make-thing 'pizza robot-lab)) (ask pizza 'set-owner holly). Sketch environment diagram, illustrating full structure of pizza at point where this expression is evaluated.

  Creating context diagram for new system

Create a context diagram for new system. Create a diagram 0 DFD for new system. Write brief memo that describes the significance of leveling a set of DFDs.

  Design pseudocode and flowchart for swallowing a pill

Write a solution in pseudocode for swallowing a pill. Translate solution into flowchart. Write about which tool they like best and why? Which tool do they think would be easiest to learn?

  Draw entity-relationship diagram students playing games

Draw an entity-relationship diagram for the following situation: Many students play many different sports. One person, called the head coach, assumes the role of coaching all these sports.

  Systems analysis and design methodologies

difference between "Requirements Determination" and "Requirements Structuring", deliverables on or after coding, testing and installation, distinction flanked by system documentation and user documentation, pertinent classes, attributes, operations

  Three possible social effects of feasibility study

In context of a feasibility study explain one cost, one benefit and three possible social effects which would be considered.

  Create the crow-s foot erd segment for employment

FRC keeps a history of the employment of all mechanics. The history includes the date hired, date promoted, date terminated and so on. Given those requirements, create the Crow's Foot ERD Segment.

  Create and annotate class hierarchy for types of faculty

Create and annotate a class hierarchy to represent various types of faculty at a university. Show what characteristics would be represented in various classes of hierarchy.

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