Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Visual Basic Expert

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

Visual Basic, Programming

  • Category:- Visual Basic
  • Reference No.:- M9523350

Have any Question?


Related Questions in Visual Basic

Please show how to do the belowvisual basic net application

Please show how to do the below: Visual Basic .NET Application - Coding Exercise 1 (Exercise 13, Zak, 2016, p. 347) For this coding exercise, write the Visual Basic code for a pretest loop that uses an Integer variable n ...

Pitch amp game design documentthe assignment is about

Pitch & Game Design Document The assignment is about educational driver for teenagers Assignment Brief: In groups you will: - present a pitch and produce a one sheet - provide a demonstration of your game - produce a hig ...

Assignment virtual storeuse the concepts and scenario from

Assignment: Virtual Store Use the concepts and scenario from Assignment 1 to help "Your" Virtual Business to increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must stor ...

Assignment frans virtual fruit standfrans virtual fruit

Assignment: Fran's Virtual Fruit Stand Fran's Virtual Fruit Stand is an online store that sells several types of dried fruit. Based on the needs of Fran's Virtual Fruit stand, you must design a flowchart using Visual Log ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As