Project Name: Lab2A Create Class: Various
Write a Console App (.NET Framework) that:
Makes use of an abstract class called Shape which represents one single shape
Creates an object hierarchy to include additional classes for:
Rectangle
Square
Box
Cube
Ellipse
Circle
Cylinder
Sphere
Triangle
Tetrahedron
Prompts the user via a menu to create an instance of one of your shapes
Uses polymorphism to store shapes into a list
Continues to prompt until the user selects the exit option
Displays a neat, orderly table of all instantiated shapes, their dimensions, areas and, in the case of three-dimensional shapes, their volumes
The main class (Lab2) should have the following features:
A list to store shapes of any kind
Error checking for user input
The Main( ) method should be highly modularized
You are to use this unmodified code for the abstract Shape class (save and rename as [login to view URL])
Each of your derived classes must implement in some way:
A SetData( ) method that prompts the user to enter each dimension for the current shape
A CalculateArea( ) method that calculates the area of the shape, or for a three-dimensional shape, the surface area
A CalculateVolume( ) method that calculates the volume of three-dimensional shapes only
An overidden ToString( ) method that you can use to print each line of the table
It is recommended that you code each of your classes in a different .cs class file (ie, [login to view URL], [login to view URL], etc.)
You may find Wikipedia useful for determing the formulae needed for area and volume calculations
You may download this sample program for a demonstration of program behaviour
The challenging part of this program is in creating a proper hierarchy:
It is recommended that you work on one class at a time
You must create an actual hierarchy that does not simply involve having all classes descend from the base class
Hair Today
Project Name: Lab2B
Write a Windows Form App (.NET Framework) that:
Makes use of a GUI interface (shown to the right) that determines pricing for a hair salon
The user must:
Select one Hairdresser, each of which has a different base rate:
Jane - $30
Pat - $45
Ron - $40
Sue - $50
Laurie - $55
Select one or more Services, each of which has a different rate:
Cut - $30
Colour - $40
Highlights - $50
Extension - $200
Select one Client Type, which determines what that client's discount rate will be:
Standard Adult - 0%
Child - 10%
Student - 5%
Senior - 15%
Enter the Number of Client Visits, which may provide an additional discount:
1 to 3 visits - 0%
4 to 8 visits - 5%
9 to 13 visits - 10%
14+ visits - 15%
The Number of Client Visits must be validated as a positive integer value
The Calculate button will determine and display the Total Price
The Calculate button must ensure that the user selects at least one Service and provides a positive integer value for Number of Visits, otherwise set the focus to the control in question
The Clear button will clear all controls, select the first radio button in each groupbox, and set focus to the first radio button in Hairdresser
See the documents below: