Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have four problems any help is appreciated thanks My apologies I failed to men

ID: 3757998 • Letter: I

Question

I have four problems any help is appreciated thanks

My apologies I failed to mention that the code needed is PYTHON.

Problem 1

Write a program to do the following. Ask the user to enter a vowel (i.e. ‘a’, ‘e’, ‘i’, ‘o’ or ‘u’). If it is not a vowel, ask the user to reenter until a vowel is entered. Define and use the following function:

is_not_vowel: test whether is letter is not a vowel. Return True if the letter is not a vowel. Return False if the letter is a vowel.

In the main function, ask the user to enter a vowel. Pass the letter to theis_not_vowel function to test whether it is a vowel or not. Repeat this until a vowel is entered. Display the vowel entered by the user.

The following is an example.

Enter a vowel: [a/e/i/o/u] x

Letter entered is not a vowel. Please try again.

Enter a vowel: [a/e/i/o/u] k

Letter entered is not a vowel. Please try again.

Enter a vowel: [a/e/i/o/u] u

Problem 2

Lunch combos in a café include sandwich, side item and a drink. There are three choices for sandwich:

Grilled cheese sandwich          $3.00

Chicken sandwich                  $3.50

Turkey sandwich                   $4.00

There are four choices for side item:

French fries            $1.50

Mashed potato        $1.50

Green bean             $1.25

Garden salad          $2.00

There are three choices for drink:

Coffee          $1.25

Iced tea        $1.00

Soda            $1.00

Write a program for customers to choose lunch combo items. Define and use the following three functions:

choose_sandwich: Display sandwiches and get user choice

choose_side: Display side items and get user choice

choose_drink: Display drinks and get user choice

Each of these functions returns the price of the chosen item. Calculate and display the total price in the main function. The following is an example.

Pick a sandwich:

1. Grilled cheese sandwich $3.00

2. Chicken sandwich $3.50

3. Turkey sandwich $4.00

Please enter your choice: [1/2/3] 2

Pick a side item:

1. French fires $1.50

2. Mashed potato $1.50

3. Green bean $1.25

4. Garden salad $2.00

Please enter your choice: [1/2/3/4] 1

Pick a drink:

1. Coffee $1.25

2. Iced tea $1.00

3. Soda $1.00

Please enter your choice: [1/2/3] 3

Please pay this amount: $ 6.0

Problem 3

Write a program to do the following. Ask the user to enter two numbers. Compare them and display the larger one and the smaller one. Define and use the following functions:

get_numbers: Ask user to enter two numbers. Use a return statement to return them.

large_small: Compare two numbers. Use a return statement to return the larger number and the smaller number

Also write a main function to implement the mainline logic. Call the get_numbersfunction to get two numbers. Then call the large_small function and pass the two numbers as arguments. Display the larger and the smaller numbers in main.

The following are two examples.

Enter a number: 17

Enter another number: 20

The larger number is 20.0

The smaller number is 17.0

Enter a number: 15

Enter another number: 15

The larger number is 15.0

The smaller number is 15.0

Problem 4

Define three functions to convert length:

inches_to_cm(inches): Convert inches to cm. 1 inch = 2.54 cm. Return cm.

feet_to_m(feet): Convert feet to m. 1 foot = 0.30 m. Return m.

miles_to_km(miles): Convert miles to km. 1 mile = 1.61 km. Return km.

Store these three functions in a length module.

Write a program to convert lengths. Ask the user to enter lengths in inches, feet and miles. Pass the lengths to the three functions in the length module. Display the converted lengths. The following is an example.

How many inches? 12

It is equivalent to 30.48 cm

How many feet? 4

It is equivalent to 1.2 m

How many miles? 26

It is equivalent to 41.86 km

Explanation / Answer

Solution :

CODE 1 :

CODE 2 :

CODE 3 :

CODE 4 :

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote