Het P.

asked • 03/30/21

MAKING A program in c#

Business Requirements

Create a program that will print out a customized oil change schedule for a car buyer based on the car’s starting mileage for the next 3 years based on the rules set out by the dealership and the users estimated miles per year input. Here’s the guide needed to print the schedule:

First Oil Change 10,000 miles
Oil Change Every 5,000 miles after 10,000 miles
Tire Rotation Every 10,000 miles
60K Full Check, Oil Change, Filters 60,000 miles
100K Full Check, Oil Change, Tire Rotation, belts 100,000 miles and every 50,000miles after


*Cars start with an oil change at purchase

Goal

·        Gain experience using loops. There should be a loop iterating over the maintenance every 5000 miles to determine if the user needs maintenance and it should make sure it does this for an estimated 3 years worth of mileage based on the user’s input of miles per year

·        Gain experience using conditionals. There should be checks with each time through the loop to see what sort of maintenance would be needed at this interval.

Inputs

Starting mileage, estimated miles per year

What to print to console

·        A header line listing Mileage and Maintenance. Format with enough width so that everything lines up and is left aligned like the table above.

·        A row for each maintenance necessary for this car.

o  The table should start with maintenance necessary for this car based on its mileage. In other words, if the car starts with 50,000 miles, don’t show the first oil change or any oil change that would occur with 50,000 miles.

o  Note, cars will have actual mileage like 35462 not rounded up by the thousands, so 5,000 miles after 35462 is when the next oil change should occur 40,462 so that’s what shows up in the mileage column for that row.

o  Your table will show the exact mileage for each maintenance. It won’t have rows like mine above that say every 10,000 miles. You are calculating that.

o  Allow enough space to make everything line up in columns by using the format tag.

Patrick B.

No the columns do not line up ... I am leaving that FOR YOU to fix. You may also change the name of the class. I used the online C# compiler.
Report

03/30/21

1 Expert Answer

By:

Patrick B. answered • 03/30/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.