Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . c You have been asked to help a local cycle shop with a problem with their software. When you investigate you discover that

1.c You have been asked to help a local cycle shop with a problem with their software. When you investigate you discover that the functions needed to support the program seem to be missing. Read the program and documentation below and then answer the following questions.Documentation
\table[[Leg measurement (cm),Wheel Size],[24,Too short (return -1)],[24,10],[31,12],[38,14],[>48,Too tall (return -1)]]
Gear ratios are calculated by dividing the number of teeth on the drive gear (input teeth) by the number of teeth on the driven gear (output teeth).
Shifting up a gear means doubling the number of teeth on the drive gear and halving the number of teeth on the driven gear.
i. Write the function calculate_wheel_size (). You should make sure to include a suitable function header and return the correct value.
[3 Marks]
ii. Write the function calculate_gear_ratio (). You should make sure to include a suitable function header and return the correct value.
[3 Marks]
iii. Write the function shift_up (). You should make sure to include a suitable function header and return the correct values.
[3 Marks]
1.d
Professional software developers apply a set of style guidelines when writing their code in order to make their code easier to maintain, read and share with others. The following code snippet has been written by a poor programmer:i. Find and list four stylistic faults in this code.ii. What is the code doing ?[4 marks][2 marks][Total 25 Marks]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions