QUESTION 32 Create a Job class that has 3 properties: JobNumber, Hours, and Price for the job. You need to use an auto- implemented property for JobNumber, and provide get and set accessors for Hours....



QUESTION 32<br>Create a Job class that has 3 properties: JobNumber, Hours, and Price for the job. You need to use an auto-<br>implemented property for JobNumber, and provide get and set accessors for Hours. The price field value is calculated<br>as the hours times $30 whenever the hours values is set. The Price property is read-only.<br>Create a constructor that requires parameters for the job number and hours only. Also, include a ToString() method<br>that overrides the Object class's ToString() method and returns a string that contains the class name (using<br>GetType() and the job's data field values.<br>Then create a UrgentJob class that derives from the Job class. The UrgentJob class has an auto-implemented<br>property, ExtraCharge; which holds an additional charge for the urgent job.<br>For the UrgentJob class, create a constructor that accepts the job number, hours, and extra charge. Also, override the<br>Object class's ToString() method and return a string that contains the class name and all data field values, including<br>the total price (price + extra charge).<br>Finally, create an application class named JobDemo that instantiates one Job object and one UrgentJob object. Then<br>call the ToString() method to display the info of each object on the screen.<br>Attach File<br>Browse Local Files<br>Browse Content Collection<br>

Extracted text: QUESTION 32 Create a Job class that has 3 properties: JobNumber, Hours, and Price for the job. You need to use an auto- implemented property for JobNumber, and provide get and set accessors for Hours. The price field value is calculated as the hours times $30 whenever the hours values is set. The Price property is read-only. Create a constructor that requires parameters for the job number and hours only. Also, include a ToString() method that overrides the Object class's ToString() method and returns a string that contains the class name (using GetType() and the job's data field values. Then create a UrgentJob class that derives from the Job class. The UrgentJob class has an auto-implemented property, ExtraCharge; which holds an additional charge for the urgent job. For the UrgentJob class, create a constructor that accepts the job number, hours, and extra charge. Also, override the Object class's ToString() method and return a string that contains the class name and all data field values, including the total price (price + extra charge). Finally, create an application class named JobDemo that instantiates one Job object and one UrgentJob object. Then call the ToString() method to display the info of each object on the screen. Attach File Browse Local Files Browse Content Collection

Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here