Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
PROGRAMMING FOR ANALYTICS
DNSC-4211 Programming for Analytics
Mid-Term (Fall 2019)
Date: xx/xx/2019 Time: 1 hours, 15 mins
THIS IS SAMPLE MID TERM FILE FROM PREVIOUS SEMESTER
INSTRUCTIONS FOR STUDENTS:
• Duration: 1 hours 15 mins.
• Keep at least 05 mins buffer to upload the correct files/folder on blackboard
• The mid exam is INDIVIDUAL
• There are five questions, answer all questions.
• Save individual files (Total 5 working files, read the instruction given with each
question) in a folder.
• Name the folder with your GWid (), zip the folder and upload it on blackboard
• Student can use/access the resources/materials from blackboard only and notes
• Assume missing information and mention it explicitly in code as comments.
• Cell phones, chat option, use of google are not allowed. If you are observed with any
of the mentioned options or in sight, you will receive a grade of ZERO on the midterm
exam.
• Upload your midterm file folder using the link: Upload Mid-Term files folder here:
$ALL THE BEST$
1. Creating functions and plots [20 points]
In a single R file or a single R markdown file, name the file as ‘answer1.R’ or ‘answer1.RMD’
Task1: Write a function to counts the number of odd integers in vector
OR
Task1: Use iris dataset and create a scatter plot between Sepal width ~ Sepal length
2. Loops: for-loop and while-loops, loop inside loop [20 points]
In a single R file or a single R markdown file, name the file as ‘answer2.R’ or ‘answer2.RMD’
Task1: Create a list that contains the following values: 10,24,100,56,49. Write a for-loop that
only prints out the numbers which are larger than 50
OR
Task1: Create a list that contains the following letters: d,a,t,a,s,c,i,e,n,c,e. Write a for-loop
that only prints out the letters that are vowels (e.g., o,u,a,e,i)