Question
ackground: Your program will resemble one of th ose computerized systems hanging off the shelf at Wal-Mart in the automotive section which tells the user
ackground:
Your program will resemble one of th
ose "computerized" systems hanging
off the shelf at Wal-Mart in the automotive
section which tells the user what the model
number of the proper air filter for their car
is. For those of you who have never used one
before, they work like this. You push a
button to start the program, and you are
presented with a menu. This menu prompts you
for the make of your car. You are then
given another menu and prompted for the
year of manufacture. You are then given
another menu prompting you for the size of
the engine. This continues until the system
has enough information to enable it to adequately identify the mode
l of filter for your
car. Your program will do the
same thing except that it will be considerably simpler.
Specifications:
There shall be only three pieces of information necessary to identify the
filter: the make of the auto, the year manuf
actured, and the number of cylinders in the
engine. The make will be one of the following: Edsel, Austin, Catepiller, and Jaguar.
Personally, I prefer the Catepiller for crui
sing the streets of Rolla. The year of
manufacture will be from 1985 to 2005, inclus
ive. The Edsel can have 6 or 8 cylinders,
the Austin 4 or 6 cylinders, the Catepiller
15 or 20 cylinders, and
the Jaguar 6 or 12
cylinders.
Your program is to generate an air filter
model number. Every model number will have 5
characters. The first character will be the first letter of the make of the automobile
(make it uppercase). The second and thir
d characters will represent the year of
manufacture (e.g. 83 for a vehicle made in
1983). The last two characters will be the
number of cylinders (e.g. 04 for a four-cylinder
vehicle). Your program is to output that
filter model number. Of course,
there are many ways to do th
at. I will leave it up to you
to determine your method.
One possible way is to gather the info into se
parate "pieces" and output it at the "end"
of the program. Thus, at every step of th
e user input to your
program, a different
variable should be assigned
information about the user's
vehicle. For example, when
prompted for make, you might set a variable
to J for Jaguar. You might subsequently set
the year variable to 93 and set a variable
for the number of cylinders to 12. The model
number for this filter will then be J9312. You
may have other ideas of how to put all this
information together into one variable, though
this can take special efforts. You decide.
Your program is to have a menu at first to read
in the make of the vehicle. I'll talk about
menus in class. The number of
cylinders, depending on the make of the vehicle, will be
determined by the next prompt. The final piece of information necessary is the year of
the vehicle and that will be prompted for last
. The menu is to have a QUIT option. If the
user chooses the QUIT option, then control drops to the end of the program and exits
with the message, "QUITTING". If the model number is completed, then it is output to
the user and the "goodbye" message is displayed. Of course, the "goodbye" should be
displayed in any case. If you wish, you may use other menus after the
first.
~Stipulation:
the year is to be read in as a 4-digit integer value.
Your program is to output the make, year
, number of cylinders and the model of the
filter it recommends.
Note:
In this assignment, you are
required to use the if-else decision branching statement. forbidden from using the switch-case statement.
Remember: As always
Use good variable names
Use constants where appropriate
Use good formatting of your code and ad
here to the good programming practices
in general
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started