V
Vinsoft Lab
Learn • Build • Grow
Mobile Development Intermediate Paid

Kotlin Mobile Development

Learn Kotlin from the fundamentals to object-oriented programming, collections, null safety, functions and Android development foundations.

10 Weeks 24 Lessons Android Development Foundation
Your Progress 0%
LESSON 24 Final Lesson

Final Project: Student Management App Foundation

Combine Kotlin classes, lists, functions, properties and decision-making to create the foundation of a student management application.

Kotlin Code

Study the example and understand each part.

KOTLIN
data class Student(
    val name: String,
    val age: Int,
    val marks: Double
)


fun grade(marks: Double): String {

    return when {

        marks >= 70 -> "A"
        marks >= 60 -> "B"
        marks >= 50 -> "C"
        else -> "D"

    }

}


fun main() {

    val students = listOf(

        Student(
            "Brian",
            18,
            78.0
        ),

        Student(
            "Mary",
            19,
            85.0
        ),

        Student(
            "John",
            18,
            62.0
        )

    )


    students.forEach { student ->

        println(
            "Name: ${student.name}"
        )

        println(
            "Age: ${student.age}"
        )

        println(
            "Marks: ${student.marks}"
        )

        println(
            "Grade: ${grade(student.marks)}"
        )

        println("----------------")

    }

}

Kotlin is commonly developed using Android Studio or IntelliJ IDEA. These examples can be used as a foundation for Android application development.

Key Concept

A real student management application can build on this foundation by adding Android screens, databases, authentication, search, reporting and API integration.

Expected Output / Result

Name: Brian
Age: 18
Marks: 78.0
Grade: A
----------------
Name: Mary
Age: 19
Marks: 85.0
Grade: A
----------------
Name: John
Age: 18
Marks: 62.0
Grade: B
----------------

Finished this lesson?

Mark it complete to update your course progress.

Quick Knowledge Check

Test your Kotlin understanding.

Which keyword creates a read-only variable in Kotlin?

Vinsoft Lab Academy

Learn Kotlin. Build Android applications.

Build a strong Kotlin foundation and continue into practical Android application development.