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…
Don't put incorrect code..
Static & Not Final Field: Accessed by every object, Changing Non-Static & Final Field: Accessed by object itself, Non-Changing Static & Final: Accessed by every object, Non-Changing Non-Static & Not Final Field: Accessed by object itself, ChangingRead the following situation and decide how the variables should be defined. You have a class named HeartsPlayerA round of Hearts starts with every player having 13 cardsPlayers then choose 3 cards to “trade” with a player (1st you pass left, 2nd you pass right, 3rd you pass across, 4th you keep)Players then strategically play cards in order to have the lowest scoreAt the end of the round, points are cumulatively totaled for each player.If one player’s total is greater than 100, the game ends and the player with the lowest score wins. 1. How should the following data fields be defined (with respect to final and static)?(a) playerPosition (These have values of North, South, East, or West)(b) directionOfPassing(c) totalScore…
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