pl1 assignment 3_final term

2

Click here to load reader

Upload: sm-akash

Post on 17-Sep-2015

222 views

Category:

Documents


5 download

DESCRIPTION

n

TRANSCRIPT

Assignment 31. Write two functions:a. One will take 2 numbers as parameter and will return the addition value of those 2 numbers then you have to show it in the output in main function.b. Second function will take 3 numbers as parameter and calculate the sum of those 3 numbers and it will also show the output but this function will return nothing.2. Write a function that will find and show odd or even numbers from an array.

Sample output :25655218

25 is odd.6 is even.55 is odd.21 is odd.8 is even.

3. Write three functions, one will calculate the area of a triangle and another one will calculate the area of a rectangle and the last one will calculate the area of a Circle. Now user will select which area s/he wants to show. Please use necessary precaution so that the program will not show all the areas at once.

Sample output :Enter your choice: r rectangle, c circle, t triangleInput: tInsert base of the triangle: 5Insert height of the triangle: 2Area of the triangle: 5

4. Write a function that will search a particular value from an array. [Array size at least 10]5. Write a function that will sort (ascending or descending) the values from an array. [Array size at least 10].6. Write two functions that will convert the user given temperature from degree to following a. One will convert the temperature into Kelvin.b. Second one will convert the temperature into Fahrenheit. Sample output :Please Insert Temperature in degree: 28Temperature in Kelvin: 301.15Temperature in Fahrenheit: 82.47. Write a function that finds the first 20 Fibonacci numbers.Assignment Submission deadline:Date: 21.04.2015, Tuesday.Time: 11:59 pm

N.B. Submit the solution for all the seven problems in your VUES account. Rename the folder using your ID.Attend Viva on or Before : Thursday , 23 April, 2015. From 6:00 pm.