R studio coding

Job ID: 33390266

Budget: $30 – $250 USD

This assignment is designed to assess your competency in writing functions and using conditional code (both while/looping and if-else structures).

Premise
Suppose every day you wake up and you are randomly in a GOOD mood 60% of the time or in a BAD mood 40% of the time. Furthermore, anytime you have a quiz or test in a course, the grade you receive is also random based on the following:

If you take a quiz or exam when you are in a GOOD mood,

you get a 100 on 80% of such days
you get a 75 on 20% of such days
If you take an exam when you are in a BAD mood,

you get a 100 on 20% of such days
you get a 75 on 30% of such days
you get a 50 on 50% of such days
1. Write a function to generate your grade on a random quiz/exam day - name this function takeOneTest()

Comments: this function may or may not have any parameters.
when you run this function, it will output one random test score (a 50, 80, or 100).
there are multiple ways for this function, consider using the runif() or sample() functions for the random components and if-else structures.

2. Write a 2nd function to calculates an arbitrary number of exam results - name this function SemesterGrades(num_tests).

Comments: This function should call takeOneTest() a user specified number of times (num_tests).
when you run this function, it will output num_tests values, each value corresponding to a single random test score. This can be done in multiple ways as well [while() or for() ].
so for example, output from SemesterGrades(6) may result in: 100 50 80 80 100 80

3. Using the functions written in #1 and #2, answer the following question: assuming your exam scores follow the random process above, would you prefer to have your grade in a course based on 3 or 12 exams/quizzes in a given semester? Answer this question in the Readme.md file on the Github repository.

Comments: Use your functions to generate many (e.g., thousands) hypothetical students in each condition and compare results using basic descriptive statistics (means, medians, standard deviations, histograms).
With the hypothetical student from part 2, they had an average score of 81.667 on those 6 exams. A different student may have a different average.
If you found the average score after 6 exams for many many many students, you would have a good understanding on the distribution of their grades when 6 exams/quizzes are given in a semester under this process.
Compare the distributions when 3 and 12 quizzes/exams to make the assessment.

Notes/Reminders:
a) Your code needs to have good header block information (name, purpose, dates, etc...)

b) Your code needs to be readable with good variable names, comments, and clear code.
Related categories: Algorithm R Programming Language