Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 9, Problem 10E
  1. Write a program named DemoJobs for Harold’s Home Services. The program should instantiate several Job objects and demonstrate their methods. The Job class contains four data fields—description (for example, "wash windows"), time in hours to complete (for example, 3.5), per-hour rate charged (for example, $25.00), and total fee (hourly rate times hours). Include properties to get and set each field except the total fee—that field will be read-only, and its value is calculated each time either the hourly fee or the number of hours is set. Overload the + operator so that two Jobs can be added. The sum of two Jobs is a new Job containing the descriptions of both original Jobs (joined by and), the sum of the time in hours for the original Jobs, and the average of the hourly rate for the original Jobs.
  2. Harold has realized that his method for computing the fee for combined jobs is not fair. For example, consider the following:

• His fee for painting a house is $100 per hour. If a job takes 10 hours, he earns $1000.

• His fee for dog walking is $10 per hour. If a job takes 1 hour, he earns $10.

• If he combines the two jobs and works a total of 11 hours, he earns only the average rate of $55 per hour, or $605.

Devise an improved, weighted method for calculating Harold’s fees for combined Jobs and include it in the overloaded operator+() method. Write a program named DemoJobs2 that demonstrates all the methods in the class work correctly.

Blurred answer
Students have asked these similar questions
This has to be done in visual studio, c# windows form application (.net fromework).   Question: The application should be able to do the following :• Create a class called Person which contains 4 private fields : Name(string), Surname (string),Course(string), CRNumber(int).• The class must contain 4 public properties which will be used to get and set the values of the private fields.• The class must contain a default constructer. The class must also contain an overloaded constructer which should be able to set the values of each of the private fields.• The class must contain a static ViewInfo method which will be used to display information of a queue of person objects back to the user neatly grouped underneath each other as displayed above.• Once a user clicks on the “Add Person” button then the information in the respective textboxes should be used to create a Person object (using the properties or the overloaded constructor) and add it to a queue which is of type Person. The…
Create a class named Person that holds the following fields: two String objectsfor the person’s first and last name and a LocalDate object for the person’sbirthdate. Create a class named Couple that contains two Person objects. Create aclass named Wedding for a wedding planner that includes the date of the wedding,the names of the Couple being married, and a String for the location. Provideconstructors for each class that accept parameters for each field, and provide getmethods for each field. Then write a program that creates two Wedding objectsand in turn passes each to a method that displays all the details. Save the files asPerson.java, Couple.java, Wedding.java, and TestWedding.java.
In C#, Create a program named ConferencesDemo for a hotel that hosts business conferences. Allows a user to enter data about five Conference objects and then displays them in order of attendance from smallest to largest. The Conference class contains fields for the following: group - The group name (as a string) date - The starting date (as a string) attendees - The number of attendees (as an int) Include properties for each field. Also, include an IComparable.CompareTo() method so that Conference objects can be sorted in order from least to greatest attendees.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY