• October 6th, 2018

Mobile apps development

Paper , Order, or Assignment Requirements

The following lab is intended to exercise your skills in creating variables, arrays, functions, classes and sub-classes.

1. (50pts)Create a “Car” class with the following criteria:
o a.Properties (5)
 i. year– initialized by initializer
 ii. make– initialized by initializer
 iii. model– initialized by initializer
 iv. color– initialized by initializer
 v. currentSpeed– initialized to 0 by initializer
o b.Functions (5)
 i. init(year: Int, make: String, model: String, color: String)– Initializer function that sets year make model color based on user input and sets currentSpeed to 0.
 ii. changeSpeed(to speed: Int) -> String– This function will change the property “currentSpeed” to whatever speed parameter is provided to it. NOTE: the function will not change the speed directly it must decide if the provided speed is greater or lesser than current speed and then call either “hitTheGas” if the car needs to speed up, or “pumpTheBreaks” if the car needs to slow down. The function should return a string message like: “The car sped up by _ miles”, “The car slowed down by _ miles”, “The car didn’t change its speed” or “The car stopped”.
 iii. hitTheGas(to speed: Int) -> Int– This function accepts an integer and changes the current speed to the speed that was passed to the function ONLYof the provided speed is GREATERthan the current speed. If the speed provided is less than the current speed the function should not change the current speed.
 iv. pumpTheBreaks(to speed: Int ) -> Int -This function accepts an integer and changes the current speed to the speed that was passed to the function ONLYof the provided speed is LESSthan the current speed. If the speed provided is greater than the current speed the function should not change the current speed.
 v. stopTheCar()– This function changes the currientSpeed to 0
2. (30pts)Create a sub class “Batmobile” that inherits from the Car class
1. Properties will remain unchanged
2. Functions
 i. Override the init()function so that it only accepts year as input the rest of the attributes should be automatically initialized as such:
1. make – Bat Automotive
2. model – Batmobile
3. color – Black
4. currentSpeed – 100
 ii. shootMachineGun() -> String – This is a function of the Batmobile that returns a string: “Bang Bang Bang”
3. (20pts)Create an array named “carCollection” and add 3 cars to it, 2 regular cars and 1 Batmobile. HINT: you must create Car variables to add to the array.

Latest completed orders:

Completed Orders
# Title Academic Level Subject Area # of Pages Paper Urgency