Execution & Coding Time!
So now that you know about R Programming Language and how to get the App...
Let's Start to Coding!
The first question, we have to make a program that if we input a number, it will tell us whether it's odd or even.
The second one means we have to make a program that if we input grades, it will show us whether the student got an A,B,C etc.
And this is how you'll get the answer for the first question.
*Genap means even & Ganjil means oddAnd this is the result if you running it.
Now we move on to the second question.
Here is the code.
And here's the result.
1. setwd is used to call where your file is. E means the local disk in file explorer, and tugas smt 3 means the folder that conduct the file.
2. source means you called your file name, and don't forget to use ".R" behind it because if you just put the name without the data type, the systems can't running your file.
3. angka/nilai means the function name, and the number inside the () means data that the program have to translate.
Now let's move on to another question.
Let's just say we have this quest.
translate : The first question is about a program that have 3 variable and each var have it's own data and we have to show them all.
The second question is about how do you code if the output was like that.
So, Let's start with the first question.
kinda simple, because it's code and it's output are in the same line so we don't have to click the file then new script thing.
The second and last question for this page will be answered like this!
And yup. We using for loop things!Congratulation for me and you that we could finish the task!
That's all for today, I hope this will help. Stay healthy, happy, and love statistic & probabilitiesđŸ’–
Comments
Post a Comment