You are on page 1of 1

Programming for Analytics : HW 1 – 10 marks

Guidelines
# Read the carsales.csv file
Car_Data<-read.csv(file="HW1CarSales.csv") – This file is provided in the BB folder HW1

SUBMIT R Code Only : NAME the File as your Firstname_lastname.R


In the R code The first Line should have your Name again in comments and your ROLL Number

Answer the below questions using R coding

# Q1: (2 Marks)
# Write a code which will print the following output using for loop

*
**
***
****
*****

#Q2 Write a code using for loop which will SUM ONLY the ODD numbers between 1 and 20 ;
# 1 and 20 are included in the set
#(2 marks)

# Q3) Which are the car Makes which have Sales > 500 for February ?
#(2) Marks

# Q4) What Car maker has the MAX Average montly price ?
# (4 Marks)
# HINT Use the max() function as operated on a Vector ; Note You need to compute the Average
Monthly prices first

You might also like