Submitted by: Submitted by zaih1981
Views: 13
Words: 552
Pages: 3
Category: Other Topics
Date Submitted: 04/19/2015 05:45 PM
Name: Patterson, David Professor: Bernard Bidwell
CMIS 102/4060 Due Date: (4/16/2015)
Overview
This program will determine the type of oil a customer needs in their car based on mileage. If they have a vehicle with less than 100,000 miles, it will recommend standard synthetic. If it is over 100,000 miles, it will recommend high-mileage synthetic. The mileage will be stored as the variable vehMiles. The amount of customers is not known, so the program will use a Boolean variable oilChange to determine when to exit the program.
Declare Variables
Initialize Variables
Declare Variables
Initialize Variables
Set debug = True
Set oilChange = True
Set vehMiles = 0
Set debug = True
Set oilChange = True
Set vehMiles = 0
While (oilChange)
While (oilChange)
Write (“Please input vehicle mileage or press 0 to exit.”)
Write (“Please input vehicle mileage or press 0 to exit.”)
True
Input vehMiles
Input vehMiles
False
If (vehMiles >0 && <= 100000)
If (vehMiles >0 && <= 100000)
Write (“Your vehicle requires standard synthetic oil”)
Write (“Your vehicle requires standard synthetic oil”)
True
ElseIf (vehMiles > 100000)
ElseIf (vehMiles > 100000)
False
Write (“Your vehicle requires high-mileage synthetic oil”)
Write (“Your vehicle requires high-mileage synthetic oil”)
True
False
ElseIf (vehMiles == 0)
ElseIf (vehMiles == 0)
Write (“Your vehicle requires high-mileage synthetic oil”)
Write (“Your vehicle requires high-mileage synthetic oil”)
True
False Set oilChange = False
Set oilChange = False
Else
Else
Write (“Invalid”)
Write (“Invalid”)
Exit
Exit
Pseudo-code:
Main
Declare debug, oilChange AS Boolean
Declare vehMiles AS Integer
Set debug = True
Set oilChange = True
Set vehMiles = 0
While (oilChange)
Write (“Please input vehicle mileage or press 0 to exit.”)
Input vehMiles
If...