CSCI 4176 & 5708 – Lab Assignment 01

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (8 votes)

The goal for tis assignment is to get you familiar with the basics of Kotlin if you are coming from another OOP language such as Java. An excellent resource for Kotlin is their docs: https://kotlinlang.org/docs/home.html This assignment is not meant to be technically challenging. It is inspired from a first-year course assignment. It will expose you to Variables, Conditionals, Loops, Classes, Inheritance, Interfaces, and Collections in Kotlin. There is more than one way to solve this assignment. You can find an empty project in Brightspace that you can use a starting point on Android Studio, so you don’t have to create an Android Project to solve A1. Your code must compile. If it does not compile, you will receive a 0 (zero), and no partial marks will be given. Coding Style: You must proper names and comments. Please follow the guidelines on https://kotlinlang.org/docs/coding-conventions.html#naming-rules Public methods and classes should be documented. Please note that different than Java, Kotling does not encourage the use of @params, @return tags: https://kotlinlang.org/docs/codingconventions.html#documentation-comments Git Rules for A1: The starter code has a README.md file for you to fill your information. For future assignments you are expected to always have a README.md file with your name, banner, and any other information that you might like to add (such as references). Remember to add a gitignore (not present in the starter code). For A1, IntelliJ or Android Studio Kotlin templates will be enough. The Assignment In A1, you will implement two classes, one interface, and a fourth file with the main method for your Kotlin program. Here is the UML Class Diagram for A1: Remarks: – The name and registry properties on Doctor should be “final”. – The setPhone number in function in Doctor should return true and replace the doctor’s phone number if the string has exactly 10 characters (yes, it is an oversimplified check) and return true. It should return false otherwise – The Doctor toString should return: “Name (Registry) – PhoneNumber” – The Hospital Doctor should return: “Name (Registry) – PhoneNumber” Badge: BadgeNumber – The HospitalDoctor’s implementation of the ICanOperate interface method should return: “Scalpel please” The main method In another file you will implement the main method that will “test” your code. No user input is required, you can be creative with names In the method you will 1. Create 2 Doctors and 3 Hospital Doctors 2. Create an empty list of Doctor 3. Add the doctors to a list of Doctor 4. Iterate over the list and print the Doctor object 5. Check to see if the doctor is implementing the ICanOperateInterface. If it is print the return of the operateOnPatient method