Programs to try using arrays in R - Assignment 8
Program List
1.Student Performance Analysis
Marks of 5 students in 4 subjects over 3 semesters are stored in a three-dimensional array.
Write an R program to:
- Find the total marks obtained by each student in each semester.
- Find the average marks in each subject across all semesters.
- Determine the student who scored the highest total marks.
- Find the highest mark obtained in each semester.
2.Population Statistics
Population data of 5 cities over 10 years in 3 states are stored in an array.
Write an R program to:
- Find the total population of each state.
- Determine the city with the highest average population.
- Find the year having the maximum population.
- Calculate the average population of all cities.
3. Cricket Statistics
Runs scored by 11 players in 5 matches are stored in a two-dimensional array.
Write an R program to:
- Find the total runs scored by each player.
- Determine the highest run scorer.
- Find the average score per match.
- Display players who scored more than 50 runs in at least three matches.
4.Monthly Sales Analysis
Sales figures of 4 products over 12 months for 2 years are stored in a three-dimensional array.
Write an R program to:
- Find the total annual sales for each year.
- Find the total sales of each product.
- Determine the product with the highest overall sales.
- Find the month with the maximum sales.
5.Electricity Consumption Analysis
Monthly electricity consumption of 6 houses over 12 months is stored in an array.
Write an R program to:
- Find the total annual consumption of each house.
- Determine the month with maximum power consumption.
- Find the house with the highest average consumption.
- Calculate the overall average monthly consumption.
Comments
Post a Comment