Difference between revisions of "CSC111 Homework 5 2015"

From dftwiki3
Jump to: navigation, search
(Created page with "--~~~~ ---- =Problem #1= <br /> * Write a program called hw5_1.py that asks the user for the name of a person to sing "Happy Birthday" to, and then displays the song in a box...")
 
(Problem #1)
Line 5: Line 5:
 
<br />
 
<br />
 
* Write a program called hw5_1.py that asks the user for the name of a person to sing "Happy Birthday" to, and then displays the song in a box 52-characters wide.
 
* Write a program called hw5_1.py that asks the user for the name of a person to sing "Happy Birthday" to, and then displays the song in a box 52-characters wide.
 
+
<br />
;Example output
+
:;Example output
 
<br />
 
<br />
 
::<source lang="text">
 
::<source lang="text">

Revision as of 09:56, 24 February 2015

--D. Thiebaut (talk) 09:55, 24 February 2015 (EST)


Problem #1


  • Write a program called hw5_1.py that asks the user for the name of a person to sing "Happy Birthday" to, and then displays the song in a box 52-characters wide.


Example output


Who should we sing for? Carl
+--------------------------------------------------+
|              Happy birthday to you!              |
|              Happy birthday to you!              |
|            Happy birthday, dear Carl!            |
|              Happy birthday to you!              |
+--------------------------------------------------+


Requirements


  • This should be the outline of your program:


# hw5_1.py
# your name
# short description
def happyBirthday():
    ...

def happyBirthdayDear( name ):
    ...

def singSong( name ):
    ...

def main():
    ...

main()


  • Make sure you use the same function names as shown above, with the same parameter name. The test script will look for the same format.