Question
C++ Help! using multiple data type variable declarations, input with cin, output with cout including escape characters and formatting, arithmetic operations, boolean logic, while and
C++ Help! using 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.
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.
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
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
Consistency issues: In order to avoid total chaos in variable naming and typing, use the following:
Variable Name | Data type |
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 |
menu_pic | char (user input) |
PI | double (3.14159) |
|
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
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