Friday, 2 May 2014

CSC 721 ASSIGNMENT



1a              Write a python program to generate a triangle with base length of 10



1b           Write a python program to generate a trapezium with base length of 22

2a .    A number is either an even, odd or prime. A prime number is a number that is divisible by 1 and itself only, all prime number are odd number except 2. Write a python program that detect if a number is even, or odd , or even and prime or odd and prime. e.g.
2 = even and prime,
 9 = odd and prime
16 = even
 33 = odd

2b    Create a list of 10 scores in a file, then write a python program to read these scores and convert them to grade and also store these grades in another file.


3a           Write a python to count the number of distinct letters that makes up a word. consider the word committee c = 1, e = 2, I = 1, o = 1, t = 2
Implement your program with the following words
(i)                  Hippopotamus                                                                  
(ii)                  Hippopotamousesquipedaliophoba
(iii)                Pneumonoultramicroscopicsilicovolcanokoniosis      
      
3b           Write a python program to count the number of vowels in a word


4a       A 3-factored number is a number that is divisible by 1 and itself and with any other number. Examples of this number are
Number               factors
4                              1 2 4 = 3-factored
9                              1 3 9 = 3-factored
25                           1 5 25 = 3-factored
33                           1 3 11 33 = not 3-factored
Write a python program to print out all 3 factored numbers in range of 1 to 200
4b      Even-factored numbers are numbers that are only divisible by even number and 1. A typical example of these are
4 = 1, 2, 4
8 = 1,2,4,8
64 = 1, 2, 4, 8, 16, 32, 64
Write a program to print out all even-factored number from 1 to 200