MoKa Reads Research

Kotlin Fundamentals

Description

Join us on a journey through the powerful Kotlin programming language, utilized in diverse domains like web development, Android, and data science. Experience comprehensive modules and hands-on training to master core concepts such as data types, control flow, variables, object-oriented programming, and functions. You'll also delve into advanced topics, including exception handling, collections, generics, and cutting-edge Kotlin features like null safety, coroutines, and extension functions. Finally, get a deep dive into building systems with Gradle and explore the inner workings of the Kotlin K2 compiler. Let us take your programming skills to the next level together.

Goals

Learning Outcomes

Syllabus

Prerequisites

  • Introduction to Java

  • Introduction to Programming

Duration

  • 1 Semester or 12 Weeks

Preperations Recommendations

  • IntelliJ Idea Community

  • IntelliJ Student and Educator License

Week # Assignment # Topic
1 Introduction to Kotlin
2 1 Object-Oriented Programming
3 Generics
4 2 Collections
5 Functional Programming
6 Midterm (1-5) Build Systems
7 Parallel and Concurrent Programming
8 3 Asynchronous Programming
9 JVM and K2 Compiler
10 4 Exceptions
11 Testing
12 Final Exam

Grade Breakdown

Type Weight
Assignments (x4) 20%
Quizzes (each topic) 10%
Midterm 30%
Final Exam 40 %

Quizzes

Multiple choice quizzes for each topic that will cover the theory/keywords of the topic, but also test the student's knowledge of the in's and out's of the topic.

Assignments

Assignment 1: Kotlin Essentials (Topics 1 & 2)

Description: In this assignment, you will explore the fundamental features of the Kotlin programming language. You will write simple Kotlin programs to demonstrate your understanding of basic concepts.

Tasks:

  1. Write a Kotlin program that prints "Hello, Kotlin!" to the console.

  2. Create a Kotlin function that calculates the area of a rectangle given its length and width. Test the function with different values.

  3. Define a Kotlin class representing a 'Person' with properties for name, age, and email. Create an instance of the class and initialize its properties.


Assignment 2: Building a Task Manager (Topics 3 & 4)

Description: In this assignment, you will apply your knowledge of Kotlin collections to create a simple task manager. You will use collections like lists and maps to manage tasks and their properties.

Tasks:

  1. Create a Kotlin data class called Task with properties for task ID (an integer) and task description (a string).

  2. Implement a Kotlin program that manages a list of tasks using a MutableList. Include functions for adding, updating, and deleting tasks.

  3. Extend your task manager to categorize tasks by priority using a map. Allow users to set and change task priorities (e.g., High, Medium, Low).

  4. Write a function to display all tasks, sorted by priority.


Assignment 3: Parallel Data Processing with Kotlin Coroutines (Topic 7)

Description: In this assignment, you will explore the power of functional programming and parallelism in Kotlin using coroutines. You will work with a dataset and leverage Kotlin's functional programming features to process data concurrently, improving performance.

Tasks:

  1. Download a sample dataset (e.g., a CSV file) containing a list of records (e.g., sales transactions, sensor readings, or any dataset of your choice).

  2. Write a Kotlin program that reads and parses the dataset into a list of data objects.

  3. Implement a functional transformation on the dataset, such as filtering, mapping, or aggregating the data using Kotlin's higher-order functions (e.g., map, filter, reduce).

  4. Rewrite the transformation from task 3 using Kotlin coroutines to perform the operation concurrently on multiple records.

  5. Measure and compare the execution time of the sequential and concurrent transformations for a significant dataset. Analyze and present the results.


Assignment 4: Asynchronous File Processing and Exception Handling (Topics 8 & 10)

Description: In this assignment, you will explore asynchronous programming in Kotlin, delve into the Java Virtual Machine (JVM) environment, and practice exception handling. You will create a program that reads and processes data from files asynchronously while handling exceptions gracefully.

Tasks:

  1. Create a Kotlin program that reads data from multiple text files (at least three) asynchronously. Each file may contain lines of data.

  2. Implement asynchronous processing to analyze and transform the data (e.g., counting words, extracting specific information, or any data processing task).

  3. Handle exceptions that may occur during file reading, data processing, or asynchronous operations. Use Kotlin's exception handling mechanisms effectively.

  4. Write the processed data to an output file.

Additional Tasks (Optional):

  1. Implement error logging to capture and log exceptions that occur during file processing.

  2. Explore and discuss how the Kotlin code is compiled into Java bytecode and executed on the JVM.