0% found this document useful (0 votes)
5 views1 page

Homework Problem Set #6 - Functions

The document contains practice problems focused on writing functions in programming. It includes tasks such as calculating the sum of digits, comparing word lengths, checking character counts, rearranging strings, and managing student grades for Honour Roll determination. Each problem is designed to enhance understanding of function creation and logic implementation.

Uploaded by

czerillo2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Homework Problem Set #6 - Functions

The document contains practice problems focused on writing functions in programming. It includes tasks such as calculating the sum of digits, comparing word lengths, checking character counts, rearranging strings, and managing student grades for Honour Roll determination. Each problem is designed to enhance understanding of function creation and logic implementation.

Uploaded by

czerillo2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Practice Problems - Functions

1. Write a function that takes in a single argument, calculates the sum of all the digits of the
argument, and returns “even” or “odd” based on the sum.

2. Write a function that takes in two parameters, two words. The function should return the longer
of the two words.

3. Write a function that takes in two parameters, a word and a number. The function should return
True if the word has more characters than the number and False if it does not.

4. Write a function called rearrange(word,n) that takes in two parameters, a string and an integer.
Take the first letter of the string and move it to the end of the word and complete this process n
times. Return the new string.

5. Write a program that will:


- Ask for the number of students in the class
- For each student:
o Ask the grade average
o Determine if they are Honour Roll (>=80)
o print out a message to each student
- Calculate the total number of Honour Roll Students

You might also like