HOMEWORK 1 — Kotlin & Compose Basics ===================================== Mobile Application Development | SUZA | Semester II 2025/2026 Weight: 10% | Individual work | Due: end of Week 4 PART A — Kotlin (40 pts) ------------------------ Submit one file "HomeworkA.kt". 1. (5 pts) Write fun celsiusToFahrenheit(c: Double): Double and test with 0, 37, 100. 2. (10 pts) Write fun isPrime(n: Int): Boolean and fun primesUpTo(n: Int): List. 3. (10 pts) Define a sealed class Shape { Circle, Rectangle, Triangle } with properties. Add a function area(): Double for each using a "when" branch on Shape. 4. (15 pts) Given data class Expense(val category: String, val amount: Double), write extension functions on List: - .total() : Double - .byCategory() : Map - .topCategory() : String? Include at least 6 sample expenses in main() and print all three. PART B — Compose UI (60 pts) ---------------------------- Build a single-Activity app "MyProfileCard" that displays a personal profile card and 3 statistics. Requirements (implement as separate Composables): 1. ProfileHeader(name, title, imageRes) — circular avatar + name + title 2. StatsRow(projects: Int, years: Int, languages: Int) — 3 metric tiles 3. AboutSection(bio: String) — expandable section (tap to expand) 4. LinksRow(email, phone, website) — 3 icons; click opens Intent (email, dial, URL) The top-level ProfileScreen composes 1–4, wrapped in a Scaffold with a TopAppBar titled "My Profile". Grading: - Correct Compose usage, hoisted state, no UI state in wrong places (20) - Preview functions for each sub-composable (10) - Material 3 styling, proper spacing, works in dark mode (10) - Intents fired correctly on link clicks (10) - Clean code, meaningful names, Kotlin idioms (10) SUBMISSION ---------- - Push to GitHub repo "mad-hw1-" - Include README.md with build instructions and 2 screenshots - Submit the repo URL via Moodle before the due date