Basic R Programs to Try - Assignment 1

 Program List


1.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)

2.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)

3.Marks in n subjects of a student are stored in a file .Find the total, average and percentage.(use scan() store the marks in marks.txt)

4.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 an R script that takes as inputs hourly wage, total regular hours and total overtime hours and displays an employee's total weekly pay.

5.Display the current date using lubridate package.( learn to install and use packages)

6.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

Statistical Methods Lab ( R Language) PCCBL308 Semester 3 KTU BTech CB and CU 2024 Scheme - Dr Binu V P

Programs in R - using control statements - Assignment 2