Instantly share code, notes, and snippets.

Embed
What would you like to do?
//
// Project 1a
// iOS Spring 2018
//
// John Doe
// jdoe@zips.uakron.edu
//
// Directions: Complete each of the comments with code. Observe what the playground
// is telling you as you work.
// Instr: Declare a constant to store the maximum number of students
// in this course, which is 24
// Instr: Declare a variable to store the current number of students
// in this course, which is currently 22
// Instr: Print the number of students in the course with a nice message
// Instr: Print the maximum number of students in the course with a nice message
// Instr: Print out whether the number of students in the course is under, over,
// or just right (Hint: looking for an if-statement here)
// Instr: Go up to the declaration and alter the current number of students in the course to see the result
// Instr: Store the first names of at least 3 students in the course
// These can be imaginary
// Instr: Output the first names of all the students in the course
// Hint: looking for a for-statement here
// Instr: For each student, print their name backwards using a switch statement in a for-loop
// Hint: Yes, I know, I wouldn't use a switch statement either
// Instr: Write a function (not method) named maxStudents which just returns the maximum number of students
// Instr: Demonstrate calling the function maxStudents
// Instr: Write a function (not method) named getGroucho which returns the name "Groucho" if "Groucho" is in the
// string array passed as a parameter, otherwise an empty string is returned
// Instr: Demonstrate calling the function getGroucho
// Instr: Write a function (not method) named findGroucho which returns the name "Groucho" if "Groucho" is in the
// string array passed as a parameter, otherwise return nil
// Instr: Demonstrate calling the function findGroucho
// Instr: Write a function (not method) named findName which returns a given name (passed as a parameter)
// if it is in the string array passed as a parameter, otherwise return nil
// Instr: Demonstrate calling the function findName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment