Project 1 create a area and perimeter calculator
COP2010 Project #1 50 pts – Due by start of class on 9/15
You are going to create an application to calculate the area and perimeter of either a circle or rectangle. You will have text boxes to enter length, width, and radius. There will be two buttons with one for calculating the circle and one for calculating the rectangle.
Objectives:
• Learn to parse data from a text box
• Use arithmetic calculations on variables
• Use tostring to output to a text box
• Learn to use try/catch for catching errors
• Use .Clear to clear text boxes
Requirements
- Read the projects and assignments requirements pdf in the course documents section of canvas. You need to follow all of the guidelines for this project.
- Store input values into local variables of type double
- Store the calculated values into separate variables of type double
- To calculate area, perimeter use the formulas below a. Are of circle: Math.PI * (radius * radius) b. Perimeter of circle: Math.PI * 2 * radius c. Area of rectangle: length * width d. Perimeter of rectangle: 2(length) + 2(width) e. Note: when you start typing Math.PI intellisense will give prompts (it is part of the math class provided by the Visual Studio IDE)
- Use .clear method to clear text boxes. Clear length and width text boxes when calculating a circle and clear radius text box when calculating a rectangle Example form: not required to match layout, but must have text boxes, buttons, labels, etc.
Grading Rubric (possible 50 pints):
A submitted project must compile and run or it will be graded with zero points
Description Itemized Value Total
Possible Total Earned
Correct Output for text boxes: Radius, Area, Perimeter 6 pts each box 18
Correct naming of all event handlers All or nothing 10
Correct naming of all variables All or nothing 10
Proper comments and documentation NA 5
working try/catch for input error All or nothing 5
Text boxes clear All or nothing 2
Extra Credit: 2 points If the basic requirements are met you can get a possible of 2 extra points for formatting the output of the calculations so they only display to four decimal places.