关键词 > 158.326
158.326 Software Construction Tutorial 2
发布时间:2023-03-24
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
158.326 Software Construction
Tutorial 2
Create an ASP.NET Core Empty project in C# using Microsoft Visual Studio 2022 based on a modification of the Tutorial 1 Parking scenario, make sure MVC architectural pattern is applied in your implementation.
1. Define 3 classes GeneralParkingKiosk, StaffParkingKiosk and StudenParkingKiosk as follows
GeneralParkingKiosk -
Properties: GeneralHoursParked : Decimal
Method : FindGeneralParkingAmount( ): Decimal
Rule - $ 2 per hour
StaffParkingKiosk -
Properties: StaffHoursParked: Decimal
Method : FindStaffParkingAmount( ): Decimal
Rule –$ 2 for the first ten hours. For hours in excess of the ten, staff will be charged $ 2 per hour.
StudentParkingKiosk -
Properties: StudentHoursParked: Decimal
Method : FindStudentParkingAmount( ): Decimal
Rule - $ 1 per hour.
2. Add an interface IKiosk as follows:
IParking -
Properties: HoursParked: Decimal – ReadOnly
Method : FindParkingAmount( ): Decimal
3. Define three new classes GenKioskWrap, StaffKioskWrap and StudKioskWrap as follows
The three classes should
a. Implement IKiosk
![]()
![]()
![]()
![]()
![]()

b. Encapsulate the classes defined in 1(i.e., The GenKioskWrap class encapsulates the class GeneralParkingKiosk, the StaffKioskWrap class encapsulates StaffParkingKiosk, and so on)
IKiosk
|
GeneralParkingKiosk |
4. Web User Interface Design (screenshots were taken when ‘Calculate’ button clicked)
NOTE: Use Math.Ceiling function to convert decimals to the next highest integer in your calculation
HINT: Solution Explorer should show program MVC structure of C# classes and other files as the figure below:
