Code 3 Output 3 Code 4 Output 4 Code 5 def one (): print ("In function one.") def two (): print ("In function two.") def three (): print ("In function three.") def all (): one () two () three () #main---- def one (): print ("In function one.") def two (): print ("In function two.") def three (): print ("In function three.") def all (): one () two () three () ----main---- all () one () def tip (total): tip int (input ("How much do you tip? (e.g. 20 for 20%) > ")) amount total (tip / 100) + total print ("If you tip ", tip, "%, then... ", sep="", end="") print ("you would owe $", amount, " on a $", total, " total", sep="") print () #----main---- 1. Using Code 1 as an example; what line of code could you write to repeat your own name 100 times on the screen using the repeat_word() function? 2. Explain why there is no output to Code 3. 3. Consider Code 5; why is sep="", end="" used on the first print statement in the function?

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question
100%

Please send me answer within 10 min!! I will rate you good for sure!! Please solve all the questions!! Please!! Please!!

Code 1
Output
1
Code 2
Output
2
Code Snippets
def repeat_word (word, num) :
print (word* num)
#----main----
repeat_word ("yes", 5)
repeat_word ("huh?", 2)
def chatter (name) :
print ("Hi, ", name, "!", sep="")
print ("How are you doing, ", name, "?", sep="")
print (name, "are you having a good day?")
print (name, "you are pretty quiet.")
#----main---
user =
input ("What's your name? > ")
chatter (user)
Transcribed Image Text:Code 1 Output 1 Code 2 Output 2 Code Snippets def repeat_word (word, num) : print (word* num) #----main---- repeat_word ("yes", 5) repeat_word ("huh?", 2) def chatter (name) : print ("Hi, ", name, "!", sep="") print ("How are you doing, ", name, "?", sep="") print (name, "are you having a good day?") print (name, "you are pretty quiet.") #----main--- user = input ("What's your name? > ") chatter (user)
Code 3
Output
3
Code 4
Output
4
Code 5
def one ():
print ("In function one.")
def two ():
print ("In function two.")
def three ():
print ("In function three.")
def all ():
one ()
two ()
three ()
#----main----
def one ():
print ("In function one.")
def two ():
print ("In function two.")
def three ():
print ("In function three.")
def all ():
one ()
two ()
three ()
#----main----
all ()
one ()
def tip (total):
tip int (input ("How much do you tip? (e.g. 20 for 20%) >
"))
amount total* (tip / 100) + total
"1
print ("If you tip ", tip, "%, then... ", sep="", end="")
print ("you would owe $", amount, on a $", total, " total",
sep="")
print ()
#----main----
1. Using Code 1 as an example; what line of code could you write to repeat
your own name 100 times on the screen using the repeat_word() function?
2. Explain why there is no output to Code 3.
3. Consider Code 5; why is sep="", end="
the function?
end="" used on the first print statement in
Transcribed Image Text:Code 3 Output 3 Code 4 Output 4 Code 5 def one (): print ("In function one.") def two (): print ("In function two.") def three (): print ("In function three.") def all (): one () two () three () #----main---- def one (): print ("In function one.") def two (): print ("In function two.") def three (): print ("In function three.") def all (): one () two () three () #----main---- all () one () def tip (total): tip int (input ("How much do you tip? (e.g. 20 for 20%) > ")) amount total* (tip / 100) + total "1 print ("If you tip ", tip, "%, then... ", sep="", end="") print ("you would owe $", amount, on a $", total, " total", sep="") print () #----main---- 1. Using Code 1 as an example; what line of code could you write to repeat your own name 100 times on the screen using the repeat_word() function? 2. Explain why there is no output to Code 3. 3. Consider Code 5; why is sep="", end=" the function? end="" used on the first print statement in
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Function Arguments
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage