Exercise 8 : [Marks will be given]
Study the given examples and perform the following. Please do not seek any help from others.
1. Write Python functions to perform the following. Use appropriate names and validations where necessary. (You should not use built-ins or imported functions unless it is unavoidable. Take time to read and understand the question) PToC < = 5 minutes for each
i) Receive a number and return its absolute value.
ii) Receive a number and return its sign in native form.
iii) Receive a lowercase character and return its upper case.
iv) Receive a number and return its cube (to the power 3).
v) Receive two numbers and return their product.
vii) Receive three numbers and return the largest.
viii) Receive a two digit number and return the message ‘Mono Digit’ if it is a mono digit number.
ix) Receive three numbers and return their average.
x) Receive an integer and return the sum of digits.
2. Write a program to generate a list of three digit random numbers and use a function to find the difference between the maximum and minimum.
(PToC < = 5 minutes)
3. Write a python module called ‘mainMod.py’ which includes two functions ‘addThree()’ and ‘mulThree()’ . The ‘addThree()’ function is to add three integers and ‘mulThree()’ function is to multiply three integers together and return the results.
Write the main function as the ‘main()’ to receive three numbers and add them or multiply them depending on the user’s choice as ‘A’ or ‘a’ to add or ‘M’ or ‘m’ to multiply. Display the output of the program an appropriate format.
(PToC < = 5 minutes)
4. The Fibonacci sequence F0, F1, F2, … is defined by the following initial conditions and recurrence relation.
0 if n = 0
Fn = 1 if n = 1
Fn-1 + Fn-2 if n >= 2
Write a function to generate the Fibonacci sequence called ‘genFibo()’, and use another function called showFibo() to display it as a series of 10 numbers. Write a driver function main() to call those functions as appropriate.
((PToC < = 15 minutes)
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme