You must create a function that takes a string as its sole input parameter. A string is the only return from the function. Using the input string as a basis, the function should generate a filename. This will be accomplished by capitalizing the initial letter and replacing each space in the string with an underscore, i.e. (" _ "). The function should return the newly formed filename. this code below generates filename elif command == "5": # filename = make_filename5(place) print(filename)   an example would be: 'Dubai, Iraq, 2021' ------->  make_filename5     ------->'Dubai,_iraq,_2021' 'spain is beautiful' ------>  make_filename5    ------->'Spain_is_beautiful' 'America' ------>  make_filename5    -------> 'America'

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

You must create a function that takes a string as its sole input parameter. A string is the only return from the function. Using the input string as a basis, the function should generate a filename. This will be accomplished by capitalizing the initial letter and replacing each space in the string with an underscore, i.e. (" _ "). The function should return the newly formed filename.

this code below generates filename

elif command == "5":

#<you will write this function here>

filename = make_filename5(place)
print(filename)

 

an example would be:

'Dubai, Iraq, 2021' ------->  make_filename5     ------->'Dubai,_iraq,_2021'

'spain is beautiful' ------>  make_filename5    ------->'Spain_is_beautiful'

'America' ------>  make_filename5    -------> 'America'

 

 

 

 

 

 

elif command == "5":

<you will write this function here > 

filename = make_filename1(place)

print(filename)

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning