Question
Create an application named JobDemo that declares and uses Job objects. The Job classholds job information for a home repair service. The class has five
Create an application named JobDemo that declares and uses Job objects. The Job classholds job information for a home repair service. The class has five properties that include:
JobNumber - The job number
Customer - The customer name
Description - The job description
Hours - The estimated hours
price - The price for the job
Create a constructor that requires parameters for all the data except price. Include auto-implemented properties for the job number, customer name, and job description, but not for hours or price; the pricefield value is calculated as estimated hours times $45.00 whenever the hours value is set.
Also create the following for the class:
An Equals() method that determines two Jobs are equal if they have the same job number
A GetHashCode() method that returns the job number
A ToString() method that returns a string containing all job information in the following format:
Job 111 Smith exterior paint 20 hours @$45.00 per hour. Total price is $900.00
The JobDemo application declares a few Job objects, sets their values, and demonstrates that all the methods work as expected.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started