You are on page 1of 5

Project1 – VW type I engine component analyzer

Background: Here are some fun facts related to the project. The early 70's VW beetle came with a
1585cc air cooled motor that produced 50HP. The engine is highly customizable and can be downsized
for improved mileage or upsized for massive HP gains. Some engine components are bolt on. Some
components require that you take your components to the machine shop for work before you can bolt
them on. Either way, you will need to be mindful of the engine's compression ratio (cr). When the cr is
too low, you leave power and mileage on the table. If the cr is too high, your engine will be prone to
preignition, otherwise known as knock or ping. You will not be tested on the background.
Understanding of the background is not necessary for project completion.

C++ Objectives: In this homework, we will explore some of the basics of C++ programming. In
particular, we will practice working with: multiple data type variable declarations, input with cin, output
with cout including escape characters and formatting, arithmetic operations, boolean logic, while and
do while loops, if-else, nested if-else-if and/or switch branching.

Tasks:

You will need to compute several quantities.


1. The first is the engine volume (vol_engine):
(4*((bore/2)^2)*pi*stroke)/1000
2. The second is the combustion chamber volume (vol_chamber):
(((3/2)*((bore/2)^2)*pi)/1000)+head volume
3. The final quantity is the compression ratio (comp_ratio):
(engine volume/4/combustion chamber volume)+1

Additionally, the project has several menus that will operate in while or do while loops. After a user has
selected all the engine components, the program will print out the engine statistics and any applicable
warning messages. There is a closing menu that will take a user back to the top menu or allow the user
to quit the program. Make sure your program handles invalid menu choices.

There are some fixed constants that will guide the Boolean logic of the warning messages. All pistons
88mm and larger require head machine work. All pistons 90.5mm and larger require case machine
work. All strokes 78mm and larger require case machine work. All compression ratios 8.8 and higher
are too high. All compression ratios 7.8 and lower are too low.

The menus will accept menu pick q at any prompt as a way to terminate the program. Invalid menu
picks simply redisplay the current menu. As a no extra credit challenge, you may implement menu pick
z at any prompt as a way to take the user up one level (when applicable) in the menus.
Consistency issues: In order to avoid total chaos in variable naming and typing, use the following:

Variable Name Datatype


vol_engine double
vol_chamber double
vol_head Integer (from heads menu)
stroke Integer (from crankshaft menu)
bore double (from pistons menu)
comp_ratio double
PI double (3.14159)

menu_pic char (user input)


Output:

Your output must conform strictly to the output format included with this document. You must use tabs
for alignment. Items in italics and underlined are user inputs. Items in smaller font are instructional and
are not to be output. Sample output follows.

Expected Output 1:

Customize your air cooled type I VW engine

Select Crankshaft 0000cc 0.0:1


a. 69 mm stock
b. 74 mm stroker
c. 76 mm
d. 78 mm
e. 82 mm
> a

Select Pistons 0000cc 0.0:1


a. 83 mm underbore
b. 85.5mm stock
c. 88 mm overbore
d. 90.5mm
e. 92 mm
f. 94 mm
> b

Select Heads 1585cc 0.0:1


a. 51 cc stock
b. 53 cc stage I
c. 56 cc stage II
d. 60 cc stage III
> a

your engine is 85.5 bore x 69 stroke

your displacement is 1585cc

your heads have 51cc combustion chambers

your compression ratio is 7.6:1

(if applicable, one of the following two. Don't output this line)
your compression ratio is too low

your compression ratio is too high


(if applicable, one of the following three. Don't output this line)
you will need head work
you will need case work

you will need case and head work

Reselect Components 1585cc 7.6:1


a. yes
b. no (quit)
> c

oops!, Invalid Input

Reselect Components 1585cc 7.6:1


a. yes
b. no (quit)
> b

Thanks for using Engine build v1.0

Expected Output 2:

Customize your air cooled type I VW engine

Select Crankshaft 0000cc 0.0:1


a. 69 mm stock
b. 74 mm stroker
c. 76 mm
d. 78 mm
e. 82 mm
> e

Select Pistons 0000cc 0.0:1


a. 83 mm underbore
b. 85.5mm stock
c. 88 mm overbore
d. 90.5mm
e. 92 mm
f. 94 mm
> e

Select Heads 1585cc 0.0:1


a. 51 cc stock
b. 53 cc stage I
c. 56 cc stage II
d. 60 cc stage III
> c
your engine is 92 bore x 82 stroke

your displacement is 2180cc

your heads have 56cc combustion chambers

your compression ratio is 9.3:1

(if applicable, one of the following two. Don't output this line)
your compression ratio is too low

your compression ratio is too high

(if applicable, one of the following three. Don't output this line)
you will need head work
you will need case work

you will need case and head work

Reselect Components 2180cc 9.3:1


a. yes
b. no (quit)
> b

Thanks for using Engine build v1.0

Deliverables:

 (15 points) A project report discussing what your program does, how it does it, and why you
designed it the way you did. Reflect on how the project would be different if you had not used
loops. Shoot for something in the 1-2 page range. PDF format.
 (85 points) Your C++ source code (the .cpp file). Make sure to name it
project1_yourlastname.cpp.

You might also like