Having issues with these python program questions need some help to complete. Py
ID: 3758936 • Letter: H
Question
Having issues with these python program questions need some help to complete.
Python program question 1
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.
Python program question number 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.
Explanation / Answer
return -1;
}
int main() {
int userNum1 = 0;
int userNum2 = 0;
int large_small = 0;
userNum1 = GetUserNum();
userNum2 = GetUserNum();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.