Description
Assignment 1 CMSC 491 – Mobile Programming (iOS)
In this assignment you will be building a GPA calculator app. Requirements:
1- Functionalities:
a. Adding a Course: A new course will be added to the list by clicking this button. To enter a
grade from a course, user will need to enter
i. Total score (point) from Assignments
ii. Midterm score and
iii. Final score together with max possible points from each task.
User will also need to enter weight of each task out of 100% and the credit amount for this
course (Always show some default text with meaningful numbers in each text field). The
calculation engine will calculate the total weighted score of this course and decide the letter
grade using the following matching:
A: 90-100, B: 80-89.9, C: 70-79.9 D: 60:69.9 and F: <60
The chalkboard text should be updated with the added course and its corresponding credit
and letter grade image. Max 4 courses can be entered. If a fifth course is tried to be entered,
an error message (as an alert) should be displayed.
Another error message should also appear if not all fields are entered accurately (ex: if
the sum of weights does not make 100%, if point taken is not between 0 and max possible
point etc.). If a course with the same title is tried to be added, a different error should appear
too.
b. Deleting a Course: The course with id entered will be deleted. The chalkboard and GPA
should be updated accordingly. It should show an error alert if id is not present in current
list. The Delete button should be disabled at the beginning and when no course is in the
list (after removing all current listed courses in the chalkboard).
2- You need to create classes like “Assessment” and “Course” with appropriate properties and
functions.
3- At the beginning (when no course added), GPA should show nothing (just “GPA: ”) as white
color. With the first course added, it should be calculated and should appear. Color of GPA
text should change as follows:
a. Green if GPA is between 3.0 and 4.0
b. Orange if GPA is between 2.0 and 2.99
c. Red if GPA is less than 2.0
4- The app should work only in Portrait mode.
5- The appearance of the app should look the same/good for all iPhone types. Use auto layout
constraints to achieve it. Do not use Stackview in this assignment.
6- You can use the image resources (letter grades, app icon, chalkboard, gpa-calculator-title)
provided. Finding and using your own but similar images is highly recommended.
UI related customization
1- Change labels for “Add Course” and “Delete Course” to images and find/use appropriate
images without breaking the good looking appearance (You can check
https://www.freepik.com/ for sample images).
2- Add a custom font with appropriate changes in “info.plist” and use it (You can check
https://www.dafont.com/ for some fonts).
3- Create your own title logo image from online sources and use it (You can check
https://cooltext.com/ )
4- Create/Find your own app icon and use it.
5- Also, in general you are free to re-organize the locations of UI items as long as the functionality
stays the same and the appearance is the same with different device sizes.
Submissions should be made in Blackboard before 11:59 pm on 2/14 .
General Grading Criteria:
1- Appearance: (30%)
2- Functionality:
a. Adding (40%)
b. Deleting (15%)
c. Errors (15%)
Screen shots in iPhone SE (4-inch), iPhone 7 (4.7-inch) and iPhone 7 plus (5.5-inch)
More screenshots from run time.
1) Initial Screen
2) After “Mobile programming” and “Algorithms” courses are added. GPA is also updated.
3) After 4 courses are added and a fifth one is tried, it gives error.
4) “Data Structures” and “Algorithms” are deleted.
Assignment 2 CMSC 491 – Mobile Programming (iOS)
In this assignment you will be building a Shopping app called ShopME.
Initial (Home) Screen:
It will show a screen with the shopping categories (initially 8) and other 2 user items to reach
recent orders and cart directly. Navigation Controller should be used to have back navigation
capability from each new screen opened. Set the navigation controller title view to app logo.
Total 10 items (first two are for user convenience)
1) Recent Orders 2) Cart 3) Grocery, 4) Clothing, 5) Movies, 6) Garden,
7) Electronics, 8) Books, 9) Appliances, 10) Toys
View:
• UICollectionView as grid layout (each item with size 125 x 125).
• Each item need to be designed as “CategoryCell” with an image and a label under it.
• Landscape mode should work too.
• Use background image with some high transparency.
Functions:
• Clicking each category opens corresponding category page.
• Recent Orders will open recent orders page with the list of only last 10 orders done by the
customer.
• Cart should go to the cart page.
Category Page:
View:
• Should be designed as UITableView.
• The name of the category will be seen at the top (as title).
• Cart should be shown as a right bar button item on the navigation bar with a label on it
(as subview) showing the current item count in the cart.
• List of items in that category will be listed.
• Each item should be customized as a cell with image (on the left), labels showing name
(with 1 line and background color), description (3 lines) and price (in the middle) and Add
button with an image of “+” on the right.
Functions:
• Clicking “+” button in each item will add it to the cart and the cart label on the top right
will be updated with the updated item count in the cart.
• Go back to Home page.
• Go to Cart by clicking Cart button.
Shopping Cart page:
View: The list of items in the cart (UITableView).
Each cell will show name, subtotal (unit price x count), count and
increase/decrease arrows.
There should be sections with each shopping category.
Total amount that needs to be paid.
Total item count in the cart.
Buy and Empty buttons.
Title as “Your Cart”
Functions:
1. Edit the number of each item by clicking increase and decrease buttons.
2. Remove an item: This will be done by setting the current count (of each item) to 0. When
item count is 0, it should be removed from the cart and cart should be updated.
3. Empty cart: Remove all.
4. Buy:
• Alerts the user about the price with “Cancel” and “Place order” options. Cancel will
only close the alert and do nothing.
• Place order option should record the order to recent orders page with only item
count and total price information and with date of the purchase.
• Empties the Shopping cart.
• Goes to Home screen.
Recent Orders page:
View: The list of only last 10 orders (UITableView) sorted by date. Most recent one first.
Each cell will show only item count purchased, total price and date of the
transaction.
Functions:
1. Remove the selected order by clicking Edit button. If user did 11 orders and only last 10
orders are shown in the list, removing one will show 9 orders. It does not need to fill
removing item’s space with 11th order.
Manager page:
View: You can reach this screen from the home screen with a right/left bar button
named “Manage”. The page will let you enter a new shopping item, with a
category currently defined or with a new category. Use your judgement on the
design (no screenshot provided) and the necessary UI items needs to be used
and necessary information needs to be received from the user (image, name,
description, price etc.).
Functions:
1. Use imagePicker to receive the item’s image from user, and if a new category will be
defined to get category image from user. Once all the necessary information is entered,
by clicking “Add” the item will be entered to the defined category. If there is no matching
category is defined, an error should be shown, unless it is submitted as a new category
and image. User can go back to Home screen any time and new added items should be
seen in the categories added or under the new category added. New category should
also be seen in home screen with its image.
General Guidelines:
• You need to use Classes like Category, CategoryItem (For UI) subclass of
UICollectionViewCell, ShoppingItem, ShoppingItemCell (For UI) sublass of UITableViewCell
etc.
• You can use stackviews for auto layout if needed.
• The app should look similar for every iPhone/iPad type (In home screen number of items in
each row can be different per design of Collection view).
• It should work for both landscape and portrait.
• Shopping Cart page will need to have Home button as navigation bar right item (with unwind
segue).
• Some image resources are provided but you are free to create/use your own. Make sure,
every category has at least 5 items with name, image, some description and price. For the
image resources provided for some shopping items, you can set your own name, description
and price. Make them reasonable.
Submission Guidelines:
• Make sure your app is running before submitting.
• Submissions should be made in Blackboard before midnight on 3/4. Up to 3 submissions are
allowed.
• Up to 2 days late submissions only.
• Make sure all your images and other resources used are inside the project folder. When
copying an image inside the Assets folder, always make sure “copy” is checked and select
the target as the project.
General Grading Criteria:
1- Appearance: (50%)
a. Initial Screen
b. Category Page
c. Shopping Cart Page
d. Recent Orders Page (sorted orders)
e. Manager Page
2- Functionality: (50%)
a. Adding items to shopping cart
b. Updating item counts in shopping cart (Removing item when item count drops to 0).
c. Emptying the cart
d. Buying the order and placing it to recent orders page
e. Deleting Orders in recent orders page
f. Error Alerts
g. Adding a new item in Manager page
Some screenshots from run time.
1) Initial Screen with navigation bar having title view with logo of the app. The first two items
are “Recent Orders” and “Cart (X)” where X is current item count in the cart. During the
shopping, anytime you come back to this screen, X should show the right item count
currently in your cart.
2) After clicking a category (except the first two items), it will open category page, with
corresponding title. Example shows “Grocery” page opened. There should be cart button
as navigation bar right button with a label as subview on it showing the current item count
in the cart. As “+” buttons clicked for each item, the cart should be updated.
3) Clicking Cart icon in Category page or in Home page will present the ShoppingCart page
with items listed with sections. The count of each item should be able to be edited with
increase and decrease arrows. Subtotal and Total price amount in the cart should be
updated as well. If one item count becomes zero, it should be deleted from the cart and
current view should not show it anymore. An alert here should inform the user about the
item deleted, saying “item X deleted”.
4) Buy button should ask either “Cancel” or “Place order”. Place order should record the order
info in recent orders page and empty the current cart, and go to home screen.
5) Clicking “Recent Orders” in home screen should present a new screen with recent 10
order information. Only item count, total price and date of the transaction should be shown.
There is an Edit button as right bar button which allows deleting the orders in the list.
Assignment 3 CMSC 491 – Mobile Programming (iOS)
In this assignment you will be building a kids’s app called Kids Joy Center. It will be designed
only for iPad Pro 9.7 inch screen (no autolayout) in landscape mode with width=1024 and
height=768.
Initial Screen:
It will show icons for three small kid games, level of games (easy, medium, hard), play button and
high scores button. Once the player selects one of the games and level of difficulty and clicks the
play button, it will open the related view controller and the game. The user can only select one of
the games and one of the difficulty levels.
So make sure this relation is maintained. There should
be an indication that the specific game or level of difficulty is selected (similar to segmented control
object working principle in UIKit). Navigation Controller should be used to have back navigation
capability from each new screen opened. Set the navigation controller title view to app logo.
3 Game types: a) memory game, b) sorting game, c) bursting the balloons game
View:
• All items should have images.
• Only landscape mode should work.
• Use background image with some high transparency.
• This is the only screen that is allowed to be designed using Xcode interface builder (IB).
Others should be designed programmatically. For others you are allowed to use IB only
to create the view controllers and arrange necessary segues from initial screen.
Functions:
• Clicking play button will start the selected game with the selected game difficulty. User
should not be able to start the game if either the game type or difficulty level is not selected.
• High scores button will open a pop up page showing the best five scores of the player in
all games.
The content of view controllers for each game should be designed programmatically rather
than using storyboard. You can use storyboard only for linking segues from home screen to
corresponding empty view controllers.
Memory (or Pairing) Game Page (View controller):
The player is expected to find the pairs of images. When the first image is clicked, the underlying
image is shown. With the click to another image, its underlying image is also shown and if it
matches with the previous one, the cheer sound is played and images stay opened and their user
interaction is disabled. If they do not match, after 1 second, the images are closed.
View:
• Images should be added to the view programmatically. There will be 4×3 (easy), 4×4
(medium) and 4×5 (hard) images, depending on the difficulty level selected. Images
should be placed on screen evenly in any level of difficulty (distance to left and right
sides, and distance to up and down sides should be equal).
• The name of the game will be seen at the top (as title).
• Labels for time and score will be shown at corners. Time will be set to 2:00 minutes for
easy, 1:45 for medium and 1:30 for hard.
Functions:
• You can use touches or gesture recognizers to interact with user.
• There will be timer counting to zero (updated every second with Timer) and score part.
Every time a new pair is found in 3 sec (after previous found), 5 points added to score. If
it is found in more than 3 seconds but less than or equal to 7 seconds, 4 points is added.
If it is found more than 7 seconds, 3 points added.
• If user goes back to initial screen, the game will be lost.
• If user achieves finding all pairs before time expires, score will be recorded in high
scores if it is within top 5 (in terms of score only). Also, it will ask user if he/she wants to
play again. Answering “No” will take the user to initial screen. If the game ends before
user finishes opening all, it will say, you lost the game and ask if he/she wants to play
again (as alert).
• Every time the game starts it will randomly decide the locations of image pairs. 10
animal images are given in image resources. They can cover up to 20 images. However,
if fewer number of images is needed (say as in easy and medium), you will need to
randomly select which of the 10 images will be shown. You are free to choose your own
images (with no backgrounds, so png images).
Sorting (the Vehicles) Game Page (View controller):
The player is expected to sort the vehicles based on the part of the earth they are used, namely,
air, water, land. The images will be randomly selected from a pool of 15 images and located at
the top part. Player will be able to drag them with one finger to the right areas he thinks they are
used. An appropriate sound should be played if the vehicle is dragged to correct area and finger
is lifted there. If it is not correct area, the image will slowly go back to initial location with an
animation (say in 2-3 sec) from the location the finger is left.
View:
• Images should be added to the view programmatically. There will be 8 (easy), 10
(medium) and 12 (hard) images, depending on the difficulty level selected. The distance
between the images (at their initial location) should be arranged equally, so appropriate
frame locations for images should be calculated while adding the images to the view.
• The name of the game will be seen at the top (as title).
• Labels for time and score will be shown at corners. Time will be set to 1:00 minutes for
easy, 45 sec for medium and 30 sec for hard.
• You can approximately define the correct areas for each of air, water, and land in the
given background image using 1-2 rectangular views.
Functions:
• You can use touches or gesture recognizers to interact with user. Custom cocoa touch
classes can be written.
• There will be timer counting to zero (updated every second) and score part. Every time a
vehicle is located to the correct area in 2 sec (after previous correct placement) 5 points
is added to score. If more than 2 seconds but less than or equal to 4 seconds has
passed, 4 points is added. If more than 4 seconds has passed, 3 points is added.
• If user goes back to initial screen, the game will be lost.
• If user achieves locating all the vehicles to correct areas before time expires, score will
be recorded in high scores if it is within top 5 (in terms of score). Also, it will ask user if
he/she wants to play again. Answering “No” will take the user to initial screen. If the
game ends before user drags all items to correct areas, it will say, you lost the game and
ask if he/she wants to play again (as alert).
• Every time the game starts, the images will be randomly determined from the pool of 15
images. You are free to choose your own images (with no backgrounds, so png images).
(Bursting the) Balloons Game Page (View controller):
The player is expected to burst the balloons as they come from the bottom of the screen. The
balloons will come with numbers on them determined randomly. There are 10 balloon images with
different colors, so each balloon color will also be determined randomly. When a specific balloon
is burst with user touch, the number on the balloon will be added to the score (also add a balloon
burst sound at that moment).
There will also be bonus balloons (with star image on it) or killer
balloons (with skull image). Bonus ones will have higher speed than regular balloons and if burst
will slow down the speed of the new balloons in the next 5 seconds. Killer balloon will have slower
speed than regular balloons and if burst will end the game.
View:
• Balloons should be added to the view programmatically at every sec.
• The numbers on the balloons will be selected from range 1-9 in easy, 1-7 in medium and
1-5 in hard level.
• The speed of the balloons should increase as the difficulty level increases (you can
decide reasonable speeds considering that this app is for kids).
• Moreover, there will be one balloon added (animated from bottom to top) at every sec in
easy level. In medium mode, there can be one or two balloons added (with 50% chance)
at every sec. In hard mode, there can be one, two or three balloons added (with 33.3%
chance) at every sec.
• You can define 10 different spots (that do not overlap) of entrance for the balloons from
the bottom of the screen. The entrance location should be decided randomly out of these
10 possible spots. Also, if multiple balloons will be added at current sec, then their
selected locations should be different.
• The name of the game will be seen at the top (as title).
• Labels for time and score will be shown at corners. Time will be set to 1:00 minutes for
easy, 45 sec for medium and 30 sec for hard.
Functions:
• You can use touches or gesture recognizers to interact with user.
• There will be timer counting to zero (updated every second with Timer) and score part.
Every time a balloon is burst, the number on the balloon will be added to the score.
• If user goes back to initial screen, the game will be lost.
• The game will end when the timer expires or the user cannot burst a balloon in the last
10 sec. When it ends because the time expires, score will be recorded in high scores if it
is within top 5. Also, it will ask user if he/she wants to play again. Answering “No” will
take the user to initial screen. If the game ends because player did not burst any balloon
in last 10 sec, it will say, you lost the game and ask if he/she wants to play again (as
alert).
• Every time the game starts it will randomly decide the colors of balloons, their entrance
spot from bottom and numbers on them. 10 balloon images and number images are
given in image resources. You can use your own.
• Bonus balloons will appear randomly in every 20-25 sec. They will have higher speed
than regular balloons and if burst will slow down the speed of the new balloons in the
next 5 seconds.
• Killer balloon will appear randomly in every 20-25 sec and will have slower speed than
regular balloons and if burst will end the game (do not save the score even it is in top 5).
High scores page:
View: This will be shown as pop up view with appropriate size. It will show the top 5
scores so far. Each row will show four labels: “order”, “game type played”, “level
of difficulty”, and “score”. Ex: “1”, “Sorting”, “Hard”, “40”
Functions:
• User will close the high scores pop up by clicking cancel.
• When the app is closed and reopened, the high scores will not be deleted (Apply data
persistence with UserDefaults to save the high scores and read when the app is reopened)
General Guidelines:
• Define your custom classes as needed.
• Auto layout and constraints are not needed as you need to design programmatically on a
single iPad screen only (iPad Pro 9.7 inch).
• Do not make your images stretched. Use aspect fit or fill for the content mode of the image
views.
• Most image resources are provided but you are free to create/use your own.
Submission Guidelines:
• Make sure your app is running before submitting.
• Submissions should be made in Blackboard before midnight on 3/28. Up to 3 submissions are
allowed.
• Up to 2 days late submissions only (1 day 20% penalty, 2 days 40% penalty).
• Make sure all your images and other resources used are inside the project folder. When
copying an image inside the Assets folder, always make sure “copy” is checked and select
the target as the project.
General Grading Criteria:
1- Appearance: (50%)
a. Initial Screen
b. Memory Game Page
c. Sorting Game Page
d. Balloons Game Page
e. High scores as pop up
2- Functionality: (50%)
a. Correct playing of games
b. Timer’s counting to zero
c. Randomization
d. Updates for level of difficulty
e. Adding to high scores
f. Data persistence application for high scores
g. Alerts
Some screenshots.
Assignment 4 CMSC 491 – Mobile Programming (iOS)
In this assignment you will be building a game app called MazeMan using Sprite Kit. There will
be two scenes: Main and Game Over scene.
A) Main Game Scene:
Assume the app will be run only in iPad and in landscape left and right modes only. You can
further set the screen size to iPad Pro screen size of (1024, 1366).
Game will start with blocks (obstacles) only in bottom (one row) and top part (two rows). Button
row will include two water blocks. As the game goes on, there will be a block added in every 1
second until 15 (maxBlockCount) blocks are added. Adding the blocks into the game scene
should not result overlapping items. To this extend, you can divide the screen into grids (64 x 64)
and put blocks only to grids available (not occupied by food, star, player, or previous blocks).
Player:
Initial location of the player will be lower left corner, facing right. The facing direction of player
will change either to left or right, depending on movement.
a) Life: Initially player will have 3 lives (hearts). Every time its energy becomes zero, it loses
one heart.
b) Energy: 1 Life (heart) is 100 energy. Every second it loses energy. It can gain energy by
eating the food (50 energy). It loses energy if contacts to enemies.
c) Movement: Movement of player will be achieved by swipe gesture recognizers. Swiping
to any direction will result in player move in that direction until it hits an object or edge of
screen.
d) Shooting: Player can kill the enemies by shooting. When user clicks a location, there will
be a rock thrown towards the point user touched. Rock needs to travel until it goes out of
screen, not until it comes to touch location. Moreover, the speed of all rocks thrown in any
direction should be the same (use a unit vector). Rock can go through blocks. Initial rock
count of player is set to 10. Every time it shoots, loses one rock. Only way of earning new
rocks is by time (every 30 sec). Max rock count is set to 20, cannot earn more than this.
e) Dying: Player will die either when it loses all hearts and energy or drown in water
(immediate die). No gravity will be effective initially but it will be enabled after every random
time in range [40-60] seconds and will affect only the player. Gravity will be effective only
1 second. Player will drown if it falls into water.
Enemies:
One instance of each enemy type will be added to the game at the beginning.
Enemies can go through blocks. Their damage to player’s health (energy) is different. They are
killed by rocks thrown by player. A new instance of killed enemy type reappears (after dying) after
randomly selected time in range [1-5] sec. Make all enemies moving slightly faster than player.
Enemy
Type
Image Damage to
Player
Entry Point Behavior
Dino1
60 energy
(0.6 heart)
Randomly selected
water block in the
ground row.
Goes up and down, then
waits randomly 1-3 sec
after each up and down.
Can go through blocks.
Dino2
80 energy
(0.8 heart)
Any row from right Goes left and right, waits
randomly 1-3 second after
each left and right. Facing
direction (left or right)
should change
accordingly. Can go
through blocks.
Dino3 100 energy
(1 heart)
Upper left corner,
facing right.
Can go all directions.
Selects a random direction
and continue till it hits
another object (including
blocks), then reselects
another direction. Facing
direction (left, right, up,
down) should change
accordingly.
Dino4 No damage
to player.
Not affected
by rocks
(immortal)
Left most point of
ceiling row.
It moves right and left at
the ceiling of the game
screen, and it can throw
fire balls every randomly
selected time in range [5-
10] sec.
Fire 100 energy
(1 heart)
From Dino4’s
position
Randomly created. It drops
down and goes out of
screen. Can go through
blocks.
Scores and Panels:
Node
type
Image Who can contact?
Star Every time player contacts a star, its score increases by 1 and
star disappears (removed from parent). Star is not affected by
enemies. Another star is added to screen immediately after the
previous star (at a random location which is not occupied).
Food Every time player contacts a food, its energy increases by 50
(half heart) – max 3 heart or 300 energy it can have – and food
disappears (removed from parent).
Player status panel should
be updated accordingly. Food can also be eaten by enemy
types dino1, dino2 or dino3, (not by fire coming from dino4).
Another food is added to screen immediately after the previous
food (if eaten by player). If an enemy has eaten the food, then
new one will be added after 10 seconds.
Player Status panel will be updated with current counts of star (score), rock, heart and energy.
Game Status Panel will show messages to player regarding what is happening in the game.
Some message examples could be the following. Please use your own.
1- Hello, Welcome to Mazeman!
2- Enemy (Dino1) killed
3- Bravo, you’ve got the star
4- Gravity time is very close! (maybe 3 seconds before it happens)
Music: Add music for 1) eating food, 2) scoring (contacting star), 3) shooting the rock, 4) when
rock kills enemy, 5) when player dies, 6) when player contacts to enemy.
B) Game Over Scene:
It will show a text label with the score of current game.
It will also show 3 high scores achieved till now.
Clicking screen will restart the game.
General Guidelines:
• Define your custom classes as needed.
• It is an iPad only app, and landscape only.
• Most image resources are provided (you may need to scale them), but you are encouraged
to create/use your own.
• Do not make your images stretched. Use aspect fit or fill for the content mode of the image
views.
• You can submit a README file if some changes are made (without affecting general
structure).
Submission Guidelines:
• Make sure your app is running before submitting. Also, make sure your submission
includes all files.
• Submissions should be made in Blackboard before midnight on 4/15. Up to 3 submissions are
allowed.
• Up to 2 days late submissions only (1 day 20% penalty, 2 days 40% penalty).
• Make sure all your images and other resources used are inside the project folder. When
copying an image inside the Assets folder, always make sure “copy” is checked and select
the target as the project.
General Grading Criteria:
Appearance: (40%)
a. Enemies, Player, Food, Star, Rock, Water, Blocks
b. Game Over Screen, High Scores
c. Player status panel
d. Game status panel
Functionality: (60%)
a. No overlapping of newly added nodes with current ones.
b. Scoring (when contacted with star)
c. Eating food (energy increase)
d. Losing energy (every second and every time enemy damages)
e. Movement of player by gesture recognizers until hitting a block
f. Killing of enemies by throwing rock (dino4 cannot be killed, only its fires can be
killed)
g. Throwing of rock from player towards touch point with same speed until out of screen
(Use your judgement for setting reasonable speeds to all sprites)
h. Dying (by enemies, water)
i. Applying gravity
j. Game Status panel updates (messages)
k. Player Status panel updates (rock, heart, energy and score updates)