Android Module 2 Assignment
Android Module 2 Assignment
PROBLEM STATEMENT:
If you still do not feel confident with the above, we recommend you to take a quick recap of the
module - don’t worry, practice makes one perfect! But if you are feeling confident and raring to
go, it is time to put your knowledge to work.
In our day-to-day life, we come across various problems that can be solved with the help of
programming. We will try to solve a similar problem with the help of Kotlin programming and
your problem-solving skills.
For this assignment, we will try to automate the different morning tasks which most of us
perform before going to class in college. We will create a Robot which will perform these tasks
for us to simplify our lives.
Every day in the morning we need to complete some set of predefined tasks that remain
constant. We can list the generic tasks as below:
1. Ring the alarm on time
2. Make coffee
3. Heat the water to a suitable temperature
4. Pack your bag (Keep only appropriate books for the day)
5. Cook breakfast and lunch
6. Iron the clothes
From now on a Kotlin Robot will complete the above set of tasks for us.
SPECIFICATIONS:
Make coffee:
The Robot will make coffee for you every day. You need to tell the Robot about the following
details:
1. How do you like your coffee (Black/With Milk).
2. How much sugar you’ll take.
You can also customize the preferences according to the day of the week.
To make the Robot, you need to create a project in Kotlin that will be responsible for all the
above-listed tasks. Just recall the concepts taught to you in this module and try to approach the
problem keeping those concepts in mind. So put your programming hats on, it’s time to get the
work done and sleep a bit more every day. All the best!
(*If you are not able to figure out the approach to this problem, don’t worry we have made a cheat sheet
for you that you can see on next page)
Submission
Create the project in IntelliJ IDEA and after completing it, Click on File -> Export to Zip file. Now
upload the created zip file to the progress tracker.
After uploading it, you will get the solution for the assignment. Steps to open the solution:
1. Unzip the folder.
2. Open IntelliJ IDEA.
3. Click File -> Open.
4. Now select the folder inside the unzipped solution folder.
Cheat Sheet:
1. For making the Robot, create a class Robot and give its name as a primary parameter.
2. The tasks performed by the Robot will become the functions of this class. Each function
will simply print the tasks being performed.
3. The variants for each function will become the parameters of those functions. For
storing similar items, try to make use of ArrayList and its functions.
4. After this use the object-oriented techniques using this Robot class in your main
function.
5. Also, for some detailed objects like ingredients for coffee, create a data class Coffee and
put its parameters in those. You can do this for other functions as well.