Write a script to prompt the user for his/her name (name) and an integer (num). Create a menu with 4 options that loops until the user enters 4 to quit. Options 1-3 call functions odd(num), calculation(name, num), and printname(name, num). Anything but the integers 1-4 output Invalid input and re display the menu. odd(num) prints the odd numbers from 1 to num inclusive (10 numbers on a line) calculation(name, num) returns the length of name times num printname(name, num) prints name num times use if __name__ == '__main__': to include everything but the functions so zybooks can test each function individually

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

Write a script to prompt the user for his/her name (name) and an integer (num). Create a menu with 4 options that loops until the user enters 4 to quit. Options 1-3 call functions odd(num), calculation(name, num), and printname(name, num). Anything but the integers 1-4 output Invalid input and re display the menu.

odd(num) prints the odd numbers from 1 to num inclusive (10 numbers on a line)

calculation(name, num) returns the length of name times num

printname(name, num) prints name num times

use

if __name__ == '__main__':

to include everything but the functions so zybooks can test each function individually

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
MacOS
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,