1.. Create a C++ program:. Create a vehicle warranty cl

Added on - 18 Sep 2019

  • 3

    pages

  • 781

    words

  • 123

    views

  • 0

    downloads

Showing pages 1 to 1 of 3 pages
1.Create a C++ program:Create a vehicle warranty class:oAdd the following variables (make all variables private):Vehicle MakeVehicle ModelYear manufacturedLength of warrantyoAdd the following constant (make it private):Current yearoInclude the following functions (do not take any user input in the functions.Pass allneeded values in as parameters):Public set (mutator) functions for all variables (not the constant)Public get (accessor) functions for all variables (including the constant)Public function used to calculate the warranty validity.Use this formula:Year manufactured + length of warranty - Current YearIf the result is negative the warranty is not valid. Otherwise it isvalid.This function will return a boolean value (0 or 1) indicating if thewarranty is valid. If it is valid return 1.If not then return 0.In the main function:oCreate an object using the vehicle warranty class as the type.oGather user input and pass to the object:MakeModelYear manufacturedLength of warrantyoCall the function to calculate if the warranty is valid.oDisplay all information the user entered, plus the current year (use the getfunctions).oDisplay if the warranty is valid or not.oInclude appropriate output messages.oRepeat until the user chooses to quit.Compile and run your code.Submit your source code as a plain text file with a .cpp extension. Make sure it compileswithout error before submitting it.2.
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Download This Document