At the design level, enter the text circle, triangle, rectangle, or pentagon in the list box.
Add hexagon to the list during the run time.
When a user pick a shape, a message box should show the number of sides and the title of message box should be name of the shape.
If the user does not make a choice, then program should prompt the user to pick a name of the shape.
Public Class shape
Private Sub shape_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
lstShapes.Items.Add("Hexagon")
End Sub
Private Sub btnOK_Click(sender As Object, e As EventArgs)
Handles btnOK.Click
If (lstShapes.SelectedIndex = -1) Then
MessageBox.Show("Please select a shape", "Error")
ElseIf (lstShapes.SelectedItem.ToString() = "Circle") Then
MessageBox.Show("Number of Sides: 0", "Circle")
ElseIf (lstShapes.SelectedItem.ToString() = "Triangle") Then
MessageBox.Show("Number of Sides: 3", "Triangle")
ElseIf (lstShapes.SelectedItem.ToString() = "Square") Then
MessageBox.Show("Number of Sides: 4", "Square")
ElseIf (lstShapes.SelectedItem.ToString() = "Rectangle") Then
MessageBox.Show("Number of Sides: 4", "Rectangle")
ElseIf (lstShapes.SelectedItem.ToString() = "Pentagon") Then
MessageBox.Show("Number of Sides: 5", "Pentagon")
ElseIf (lstShapes.SelectedItem.ToString() = "Hexagon") Then
MessageBox.Show("Number of Sides: 6", "Hexagon")
End If
End Sub
End Class


At the design level, enter the text circle, triangle, rectangle, or pentagon in the list box....
Problem: Given information about a circle, rectangle and a triangle, calculate the area of the shape from the information supplied. Write pseudocode to solve this problem and write a Python program that asks the user to input the required information for a shape and then calculates the area of the shape. Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1...
Menu-driven programs will display the menu options to the user and then prompt them for a menu choice. This program will display the following menu in the following format: Calculator Options: Calculate the area of a circle Calculate the area of a rectangle Calculate the area of a triangle Calculate the area of a trapezoid Calculate the area of a sphere Exit Enter your choice (1-6) Once the user enters a choice for the menu, the program should use a...
Please answer 1c, use MATLAB, and paste your entire script in
your answer so that I can copy and paste to see if it works.
Problem #1 400g triangle square pentagon hexagon Figure 1 For a closed geometric figure composed of straight lines (Figure 1), the interior angles in the figure must add to (n-2)(180) where n is the number of sides. Required Tasks a) Write a script that prompts the user to select from one of the following shapes:...
Create a menu-driven program (using the switch) that finds and displays areas of 3 different objects. The menu should have the following 4 choices: 1 -- rectangle 2 -- circle 3 -- triangle 4 -- quit If the user selects choice 1, the program should find the area of a rectangle. rectangle area = length * width If the user selects choice 2, the program should find the area of a circle. circle area = PI * radius * radius...
Design program so that it correctly meets the program specifications given below. Specifications: Create a menu-driven program that finds and displays areas of 3 different objects. The menu should have the following 4 choices: 1 -- square 2 -- circle 3 -- right triangle 4 -- quit If the user selects choice 1, the program should find the area of a square. If the user selects choice 2, the program should find the area of a circle. If the user...
C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...
(The Triangle class) Design a class named Triangle that extends the GeometricObject class. The Triangle class contains: - Three float data fields named side1, side2, and side3 to denote the three sides of the triangle. - A constructor that creates a triangle with the specified side1, side2, and side3 with default values 1.0. - The accessor methods for all three data fields. - A method named getArea() that returns the area of this triangle. - A method named getPerimeter() that...
Java Please - Design and implement a class Triangle. A constructor should accept the lengths of a triangle’s 3 sides (as integers) and verify that the sum of any 2 sides is greater than the 3rd(i.e., that the 3 sides satisfy the triangle inequality). The constructor should mark the triangle as valid or invalid; do not throw an exception. Provide get and set methods for the 3 sides, and recheck for validity in the set methods. Provide a toString method...
GUI in java: Run the below code before doing the actionlistener: import java.awt.*; import javax.swing.*; public class DrawingFrame extends JFrame { JButton loadButton, saveButton, drawButton; JComboBox colorList, shapesList; JTextField parametersTextField; DrawingFrame() { super("Drawing Application"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JToolBar toolbar = new JToolBar(); toolbar.setRollover(true); toolbar.add(loadButton=new JButton("Load")); toolbar.add(saveButton=new JButton("Save")); toolbar.addSeparator(); toolbar.add(drawButton=new JButton("Draw")); toolbar.addSeparator(); toolbar.addSeparator(); toolbar.add(new...
JAVA Code Requried Copy the file java included below. This program will compile, but, when you run it, it doesn’t appear to do anything except wait. That is because it is waiting for user input, but the user doesn’t have the menu to choose from yet. We will need to create this. Below the main method, but in the Geometry class, create a static method called printMenu that has no parameter list and does not return a value. It will...