Description
Only Submit the tasks 3 and 4 Kotlin code in online.cs.miu.edu under Assignments.
Upload only the Kotlin files
Note: Do not upload compressed file. No need to use GitHub for this homework. Because IntelliJ IDEA useful for Lesson 2 Homework only. From Lesson 3 onwards you are going to work with Android Studio only.
Perform the given tasks( Submit 3 & 4 for this homework)
1. Read Lesson -1
2. Practice Kotlin fundamentals discussed in Lesson 2 and more examples in the given below link
a. https://play.kotlinlang.org/byExample/overview
3. Install IntelliJ Idea from https://www.jetbrains.com/idea and click Download and select Community based on your OS. Then do your homework using IntelliJ Idea IDE.
a. Create a function to print the last digit and first digit of the given Int value. Get integer input from the console.
Example: 1245 → 15
b. Write a function to find the sum of odd squared values in the given array of integers.
Example: Arrays contains {1, 2, 3, 4, 6, 5} Output: 12 + 32 + 52 → 1 + 9 + 25 = 35.
c. Write a Program using when expression to find the weight of a person in various planets according to the choice of user input from the console. Assume inputs in pounds.
Weight = Input * Relative gravity
Choice Planet Relative gravity
1 Venus 0.78
2 Mars 0.39
3 Jupiter 2.65
4 Saturn 1.17
5 Uranus 1.05
6 Neptune 1.23
4. Practice OO Concepts (Class, Object, Getters and Setters, Inheritance, Override etc.,
a. Create a class Book with the fields title, author and price. Make a constructor which initialize all the fields. Add a behavior with read() and just print a message “Reading Paper book”.
b. Create a subclass EBook from Book, include additional attribute filetype as String. (ex: pdf, epub, kindle etc.,). Override read() method and print the message as “Read from Electronic Device”.
c. Write a Test class. Create object for Book and EBook. Make use of getters and setters.
5. Install Android SDK in your own Machine from the given link. From Lesson 3 all apps are going to develop using only Android Studio https://developer.android.com/studio/install
To run your app using Android Emulator, need to enable VT-x from BIOS to install HAMX for Android studio. Google it the procedure depends on your platform. Will check emulator working or not during Lesson-3 practices.




Reviews
There are no reviews yet.