diff --git a/20092018/HelloWorld.java b/20092018/HelloWorld.java new file mode 100644 index 0000000..3cb8676 --- /dev/null +++ b/20092018/HelloWorld.java @@ -0,0 +1,23 @@ +/* + + - Classes must always be named starting with Capital letters + - Public classes must always be on a file with the same name as the class + - read from args: args[0] + + = HOMEWORK: + a = Print a list of numbers from 0 to 10 + b = Print a list of numbers from 10 to 0 +*/ + +public class HelloWorld{ + + public static void main (String args[]){ + //int n = 50; + for(int i=0; i<10; i++){ + System.out.println("Hello guy"); + } + + } + + +} \ No newline at end of file diff --git a/20092018/Main.java b/20092018/Main.java new file mode 100644 index 0000000..88f4af9 --- /dev/null +++ b/20092018/Main.java @@ -0,0 +1,25 @@ +class Main { + public static long fib(int input){ + if(input <= 1 && input >= 0){ + return input; + } + else if(input < 0) { + return (-1) * (fib(input + 1) - fib(input + 2)); + } + else{ + return fib(input - 1) + fib(input - 2); + } + } + + public static void main(String[] args) { + System.out.println("List of first 20 negative Fibonacci numbers:\nindex\tresult\n"); + for(int i=-20; i<0; i++){ + System.out.println(i + 1 + "\t" + fib(i + 1)); + } + + System.out.println("\nList of first 20 positive Fibonacci numbers:\nindex\tresult\n"); + for(int i=0; i<20; i++){ + System.out.println(i + 1 + "\t" + fib(i + 1)); + } + } +} diff --git a/20092018/README.md b/20092018/README.md index 5bf333f..b252e30 100644 --- a/20092018/README.md +++ b/20092018/README.md @@ -53,9 +53,6 @@ Yes I know, you found out the amazing power of pressing tab and having the auto- [Creating Environment variables: ](https://www.mkyong.com/java/how-to-set-java_home-on-windows-10/) -## Exercises -This module has a HackerRank challenge, you can check it on the following page: [www.hackerrank.com/elte-basicjava-module-1](http://www.hackerrank.com/elte-basicjava-module-1) - ## Documentation regarding the examples: diff --git a/README.md b/README.md index 8b970df..cb7c133 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ Even better, let's remember some stuff then... Any sort of plagiarism, copies, ideological falsehood or unlawful behavior may be subject of auction in the format of the university regulations. #### Course grades -* Challenges and class exercises (10%) -* Final assignment (40%) +* Challenges and class exercises (20%) +* Final assignment (30%) * Exam (50%) * Accepted pull requests can count as extra points in all the activities with grades, being that these points will never compose more than 30% of the grade.