Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing this it way more complicated then I anticipated, I need to design and write a Python Program I cannot use global

I need help writing this it way more complicated then I anticipated, I need to design and write a Python Program I cannot use global variable or the go-to statement. There are three specification as follow ;

Program Specification A

Write a Python Function that will ask the user for their age (as an integer).

Only allow the user to enter a value for age between 21 and 99.

Force the use to enter a value for age in this range and have the function return a valid age.

Age is invalid if it us not an integer. Age is invalid if it is not between 21 and 99.

Program Specification B

Write a Python function that will ask Do you drive a truck?

Make the answer for the question be either Y or N.

At the end of the function, return a value True or False.

The user dose nor understand the difference between y and Y or n and N, so the program must accept lower- or upper-case Y, y or N, n.

Program Specification C

Write a Python function that will ask the user a sentence, you will have the function return the counts of vowels in the sentence.

The vowels are A, E, I, O and U

The function will return a number representing a number of vowels found in the sentence.

The source code must be written in such a way that it will work regardless of the value of each variable.

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions