1. Write a Python program named LastnameFirstname07.py, using your last name and your first name, that does the following:

  • Define 3 functions that meet the following criteria:
    • Function 1: Uses a function from either the Math or Random module
    • Function 2: Has 2 parameters and prints a message using both parameters
    • Function 3: Has at least 1 parameter and returns a value. When the value is returned, you must do something with it.
    • You can make your functions do whatever you want, as long as it adheres to the above criteria!
  • Define a main function. In the function, do the following steps:
    • Ask the user for their name, and say hello to them.
    • List the different tasks your 3 functions can do, then ask the user which one they'd like to execute.
    • If the user does not give a valid choice, print an error message and end the program.
    • If the user gives a valid choice, execute the specified function. For at least 1 function, ask the user for input and pass their input to a function.

2. Be sure to add comments for each section of your code.

3. All code should be in a function, aside from import statements and calling the main function. Call main() only once.

4. Make sure your output is descriptive. Tell the user what you're printing, don't just print out the answers alone.

5. Your program should not use code/concepts we have not yet covered. You must demonstrate that you have mastered the concepts covered.

Expected Output

This is an example of what your program should output:

>>>
=============== RESTART: ManuelNikki07.py ===============
Hi, there! What's your name?
Jenny

Nice to meet you, Jenny!
Check out my super cool program. Here are 3 things it can do!
1. Generate a random number between x and y
2. Print the COOLEST sentence you'll ever read in your life
3. Switch the letters of your first and last name to give you a funny name
Which would you like to do? (Enter 1, 2, or 3)
3

Option 3! Sounds great!
First, please enter your first name: Mark
Now, please enter your last name: Brown

I'm going to switch the letters of your first and last name to give you a funny name!
Your new name is....... Mark Brown
HAHA! Isn't that hilarious?

Thanks for using my program! Bye!
>>>

This is another example of what your program should output:

>>>
=============== RESTART: ManuelNikki07.py ===============
Hi, there! What's your name?
Jen

Nice to meet you, Jen!
Check out my super cool program. Here are 3 things it can do!
1. Generate a random number between x and y
2. Print the COOLEST sentence you'll ever read in your life
3. Switch the letters of your first and last name to give you a funny name
Which would you like to do? (Enter 1, 2, or 3)
100

Error! There's no such thing as option 100!
Please restart the program to try again.
>>>

This is another example of what your program should output:

>>>
=============== RESTART: ManuelNikki07.py ===============
Hi, there! What's your name?
Mike

Nice to meet you, Mike!
Check out my super cool program. Here are 3 things it can do!
1. Generate a random number between x and y
2. Print the COOLEST sentence you'll ever read in your life
3. Switch the letters of your first and last name to give you a funny name
Which would you like to do? (Enter 1, 2, or 3)
one, please! :)

Error! You needed to type in a number value! For example: 1
Please restart the program to try again.
>>>
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.