1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mariana [72]
3 years ago
11

Create a constructor that requires parameters for the job number and estimated hours only. Also, include a ToString() method tha

t 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. The Job class has a child class named RushJob that includes an auto-implemented property, ExtraCharge, which holds an additional charge for the job. For the RushJob class, you need to create a constructor that accepts the job number, estimated 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, as well as the total price (i.e., price + extra charge). Finally, create an application class named JobDemo that instantiates one Job object and one RushJob object. Then call ToString() method and display the info of each object on the screen.
Computers and Technology
1 answer:
Elodia [21]3 years ago
5 0

Answer:

See explaination

Explanation:

Job.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace JobApp

{

public class Job

{

private int jobNumber;

private int estimatedHours;

private double price;

public Job(int jobNum, int estHrs)

{

jobNumber = jobNum;

estimatedHours = estHrs;

CalculatePrice();

}

public int JobNumber { get; set; }

public int EstimatedHours

{

get { return estimatedHours; }

set { estimatedHours = value; CalculatePrice(); }

}

private void CalculatePrice()

{

price = estimatedHours * 45;

}

public virtual double getPrice()

{

return price;

}

public override string ToString()

{

return GetType() + "\n" +

"Job No: " + jobNumber + "\n" +

"Est. Hrs.: " + estimatedHours + "\n" +

"Price: $" + price;

}

}

}

RushJob.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace JobApp

{

public class RushJob : Job

{

private double additionalCharge;

public RushJob(int jobNum, int estHrs, double additionalCharge):base(jobNum, estHrs)

{

this.additionalCharge = additionalCharge;

}

public override double getPrice()

{

return this.additionalCharge + base.getPrice();

}

public override string ToString()

{

return

base.ToString() + "\n" +

"Additional Charge: $" + this.additionalCharge + "\n" +

"Total Price: $" + getPrice();

}

}

}

JobDemo.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace JobApp

{

class JobDemo

{

static void Main(string[] args)

{

Job job = new Job(101, 10);

Console.WriteLine(job.ToString());

Job rushJob = new RushJob(102, 15, 5);

Console.WriteLine("\n"+rushJob.ToString());

Console.ReadKey();

}

}

}

You might be interested in
How does Greenscreen work
Drupady [299]
<span>All of this high-tech fakery happens with the help of backdrops of brightly colored fabric or paint, and a process called "chroma key," also referred to as "green screen" due to the backdrops' color, which is typically a vivid green. ... Chroma keying isn't just for backgrounds; it works with objects, too.</span>
5 0
3 years ago
Read 2 more answers
________ is used for supervisory messages at the internet protocol layer.
Natalija [7]
"ICMP" <span>is used for supervisory messages at the internet protocol layer.
ICMP stands for </span>Internet Control Message Protocol and it refers to a supporting protocol in the Internet protocol suite. It is utilized by network devices which includes routers and these are used to send error messages and operational data showing, for instance, that asked for service which isn't accessible or that a host or switch couldn't be come to.
4 0
3 years ago
Alice recently purchased a new cell phone. After her vacation, Alice wanted to transfer her holiday photos to her computer to do
dmitriy555 [2]

Answer:

<u>D.) Device Manager</u>

Explanation:

Indeed, the device manager administrative tool found on Windows allows the user to set up or add new hardware devices attached to the computer system.

For example, this tool allows the user to add external devices to the computer such as a printer, mobile device, etc that may not automatically be displayed.

5 0
3 years ago
How can you have internet without subscribing to cable?
Svetach [21]
Sorry but you can’t there is now way
7 0
3 years ago
What's a qat on a computer
suter [353]
The answer is ..........

The Microsoft Quick Access Toolbar (QAT<span>) is a toolbar menu that appears in Microsoft Excel, Microsoft Word, and other Office 2007 and above products in the top left corner of the window. As seen in the picture, the Quick Access Toolbar gives you quick access to commonly used features such as the Save feature.
</span>
hope it helps have a great one! :)
5 0
3 years ago
Read 2 more answers
Other questions:
  • If you want to be more efficient at using the World Wide Web, refresh the page often.
    7·1 answer
  • What is the output of the second println statement in the main method? public class Foo { int i; static int s; public static voi
    14·1 answer
  • Another html/css assignment, drop css code below, thank you
    15·1 answer
  • Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since th
    15·1 answer
  • Cuzzzzzzzzzzzzzzzz iiiiiiiiiiiiiiiii remember everytimeeeeeeeeee on these days that i feel like you and meeeeeeeeeeeeeee
    15·1 answer
  • Add me on blizzard none of my friends play ow<br> NADERJABER#2530
    8·1 answer
  • How to design remote access policy using the appropriate access controls for systems,applications, and data access
    6·1 answer
  • If you hard working right now go to this EASY question
    9·2 answers
  • Help PLEASE ILL MARK as brainlest
    11·1 answer
  • Can you please help me with this crossword puzzle, I am having trouble with numbers 5 down and 22 across.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!