Application to count the number of possible triangles, Visual Basic Programming

Assignment Help:

A triangle is equilateral if all three sides are equal, isosceles if any two (but no more than two) sides are equal, and scalene if no two sides are equal. A triangle will be inputted by the user by stating the three sides. The program should classify the triangle, and keep count of the number of each type of triangle.

In particular, for each iteration, first obtains the measurements of a triangle from the user. The prompt should be:

Please enter the three sides of the triangle on separate lines. Enter '-1' to quit. This should be followed by the classification of the triangle, such as:

25

5

25

The triangle is isosceles.

When the user terminates input (by entering a '-1', print out the following summary:

End of Processing.

The number of equilateral triangles was XX

The number of isosceles triangles was XX

The number of scalene triangles was XX

Structured programming must be used. In particular,

(1) Use a subprogram to prompt and obtain all the input for a single triangle from a user.

(2) Use a subprogram to determine the type of triangle based on the user input, and to update your running totals of each triangle type.

Use a pre-test loop for your processing in Main (with a priming read). Build both a C# and Visual basic Program.

Run them both using the following data for the triangle data to enter (each value on a separate line):

10.1 5 10.1

10 5.23 15

4 4 4

5.2 10 10

20.2 20.2 4.1

3 4 5

 Print the source code for each program version on a separate page, and attach the output using screen capture.

NOTE:

1. Terminate the use-input portion of the program ONLY if user enters -1 for the first side. A -1 for side 2 or side 3 should not terminate the user input.

2. You do not need to check for negative values for a triangle side. Assume all sides entered are positive values (unless the first side is a -1 to end).

3. Assume the sides entered are for an actual triangle

4. Do NOT use/change global variables - use parameter-passing


Related Discussions:- Application to count the number of possible triangles

File system controls, FILE SYSTEM CONTROLS There are 3 file system cont...

FILE SYSTEM CONTROLS There are 3 file system controls as shown in figure. The drive list box, directory list box & the file list box. The drive list box control is used to exhi

Dialog boxes in vb, DIALOG BOXES IN VB The two dialog boxes, namely, th...

DIALOG BOXES IN VB The two dialog boxes, namely, the message box and the input box are usually used in the Visual Basic. The message box is used for displaying the messages to

To calculate rectangle, two sides are given of a sheet e.g 23*36 i want hal...

two sides are given of a sheet e.g 23*36 i want half or 1/2 of this sheet next i want 1/4(one fourth) of this sheet if sheet size is 23*36 next i want 1/8 similary as above

Modeless dialog, MODELESS DIALOG The Dialog boxes are either modal or m...

MODELESS DIALOG The Dialog boxes are either modal or modeless. The modal dialog box should be closed (Unloaded or hidden) before you can continue the working with the rest of t

Explain dtd elements and dtd attributes, Problem 1. Describe the concep...

Problem 1. Describe the concept of exception in .Net environment 2. Explain the process of adding, updating and deleting records with an example 3. Explain DTD elements a

Drawing, #questiontypes of lines and how to draw

#questiontypes of lines and how to draw

Crop image from tif and paste it on Excel Sheet, I have a tiff image of 25 ...

I have a tiff image of 25 pages. I capture particular square from particular page and past on one excel sheet one by one. it is possible, if yes how. Image have line no and pe

Do until loop statement , Do Until Loop Statement: The statements with...

Do Until Loop Statement: The statements within the do...until loop block executes till the condition given in until become true. The working of do...until loop is elaborated w

Do loops, You can employ Do...Loop statements to run a block of statements ...

You can employ Do...Loop statements to run a block of statements indefinite number of times. The statements are repeated either whilst a condition is True or till a condition becom

Variable scope prefixes, Variable Scope Prefixes As script size rise, s...

Variable Scope Prefixes As script size rise, so does the value of being capable to rapidly differentiate the scope of variables. A one-letter scope prefix preceding type prefix

Write Your Message!

Captcha
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