10.Programming Assignment 1 ( Basic Programs)

Now you can try the following simple programs.

1) Area of the circle given the diameter.
2)Area of the circle given the circumference.(circumference=2*pi*r)
3)Area of the circle given center point (x1,y1) and one point on the perimeter (x2,y2).
(Hint: input the two points and compute the distance between them as radius)
4)area of a triangle given three sides a,b,c.(use Heron's formula)
5)Area and perimeter of a right angled triangle given width(w) and height(h).
(area=1/2.0*w*h .use Pythagoras theorem to find the hypotenuse then add the three sides to find the perimeter)
6).Surface area of a cube given the length of an edge.
7)Circumference,volume and surface area of a sphere given the radius.
(Circumference=2*pi*r volume=4/3.0*pi*r*r*r surface area=4*pi*r*r)
8)Area of an equilateral triangle given one side (s).( sqrt(3)/4.0*s*s)
9)Volume and surface area of the cylinder given radius(r) and height(h).
(volume=pi*r*r*h surfacearea=2*pi*r*r+2*pi*r*h)
10) Volume and surface area of a cube given one side ( s).
(volume=s*s*s surface area=6*s*s)
11)hypotenuse of a right-angled triangle, given the length of the other two sides.( university question) 
( use Pythagoras theorem)
12)Enter length and breadth of a rectangle and find its area and perimeter.
13)Enter name and marks in 6 subjects of a student and find the total, average and percentage.
14)Enter temperature in Celsius and covert it into Fahrenheit.
( F=C*(9/5.0) + 32 )
15)Write a program to read P,T, R and calculate simple interest.(SI=(P*T*R)/100)
16)Write a program to read P,T,R and calculate compound interest.(CI=P(1+R/100)*T)
17)Input a time in seconds and print the time in HH:MM:SS format ( university question)
18)Write a Python program to print the value of 2**(2n)+n+5 for n provided by the user.
19)An Employee's total weekly pay equals the hourly wage multiplied by the total hours worked plus any overtime pay.Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage.
Write a Python Program that takes as inputs hourly wage, total regular hours and total overtime hours and displays an employee's total weekly pay.
20)Calculate number of minutes in a Year (Let 1 year = 365 days 5 hours 48 minutes 46 seconds)
21)The customer requests a program that computes a person’s income tax.
let’s assume
the following tax laws:
All taxpayers are charged a flat tax rate of 20%.
All taxpayers are allowed a $10,000 standard deduction.
For each dependent, a taxpayer is allowed an additional $2000 deduction.
Gross income must be entered to the nearest penny.
The income tax is expressed as a decimal number.

Comments

Popular posts from this blog

Python For Machine Learning - CST 283 - KTU Minor Notes- Dr Binu V P

KTU Python for machine learning Sample Question Paper and Answer Key Dec 2020

46.Classes and Objects in Python- Accessors and mutators