You have a request ? Contact Us Join Us

iOS App Capstone | Coursera Quiz Answers

Coursera: Meta iOS Developer Professional Certificate. Module Quiz: Starting the Project, Project Functionality, Final Graded Quiz
Coursera: iOS App Capstone
iOS App Capstone | Meta

In this final course, you'll showcase your newly acquired skills by developing an iOS app from scratch. Throughout the course, you'll receive refreshers on key concepts from previous modules to ensure you're fully equipped for the project. Links to detailed content will also be provided for deeper review as needed. The course focuses on creating the Little Lemon app, allowing you to demonstrate your proficiency in iOS development.

This capstone is designed for intermediate learners aiming to pursue a career in iOS development. Upon completing the project, you'll have a functional mobile application to present to recruiters, showcasing your abilities effectively.Prior experience in iOS and a solid grasp of the Swift programming language are prerequisites for this course. A positive attitude and readiness to learn are also valuable assets!

By the course's end, you will have developed and potentially published a native iOS mobile app, gaining insights into the process of app deployment on the Apple Store.


Notice!
Always refer to the module on your course for the most accurate and up-to-date information.

Attention!
If you have any questions that are not covered in this post, please feel free to leave them in the comments section below. Thank you for your engagement.

Module Quiz: Starting the Project 

1. What is staging in Git?
  • Staging is the process of preparing changes to a file or a set of files to be committed to the repository. 
  • Staging is the process of deleting files from the repository. 
  • Staging is the process of creating a new branch in Git. 
  • Staging is the process of merging two branches in Git. 
2. What is the purpose of the git diff command in Git?
  • The git diff command lists out the changes between your current working directory and your staging area.
  • The git diff command is used to create a new branch in Git.
  • The git diff command is used to push changes to a remote repository in Git.
  • The git diff command is used to revert changes in Git.
3. What is the purpose of the git blame command in Git?
  • The git blame command is useful to inspect all the changes that occurred on a file during its lifetime in Git.
  • The git blame command is used to create a new branch in Git.
  • The git blame command is used to undo changes made to a file in Git.
  • The git blame command is used to merge changes from one branch to another in Git.
4. Does SwiftUI provide the ability to include a Git repository when setting up a project?
  • Yes, SwiftUI provides the ability to include a Git repository when creating a project.
  • No, version control functionality must be set up after the project is initialized in SwiftUI.
  • The ability to include a Git repository is only available for macOS projects created with SwiftUI.
  • The ability to include a Git repository is only available for projects created using third party tools, not Xcode.
5. Which template should be selected when creating a SwiftUI iOS application?
  • The App template under the iOS tab is the correct template to select when creating the regular SwiftUI iOS application. 
  • The SwiftUI template under the iOS tab is the correct template to select when creating the regular SwiftUI iOS application. 
  • The Swift App template under the iOS tab is the correct template to select when creating the regular SwiftUI iOS application. 
  • The macOS App template under the macOS tab is the correct template to select when creating the regular SwiftUI iOS application. 
6. In the new project template options menu, which option has the SwiftUI value?
  • Language
  • Interface
  • Bundle identifier
7. Complete the sentence: A wireframe's purpose is_______.
  • to create a completed design of all the typographical elements of the web app. 
  • to create a completed design for the entire website, including branding colors, and images. 
  • to create a basic structure for each screen in the design before things like branding, colors and images are considered. 
8. What is the purpose of content blocks in a wireframe?
  • Content blocks in a wireframe show the location of elements and establish an information hierarchy and flow.
  • Content blocks in a wireframe are used to add color and visual interest to the design.
  • Content blocks in a wireframe are unnecessary and can be skipped in the design process.
  • Content blocks in a wireframe are only important for designers, not users.
9. What is the benefit of using the Smart animate option in Figma?
  • The Smart animate option in Figma allows designers to create smooth animations quickly and easily.
  • The Smart animate option in Figma is only suitable for creating simple animations.
  • The Smart animate option in Figma can only be used with pre made animation templates.
  • The Smart animate option in Figma can only be used with text elements, not with other design elements.
10. What is the first stage of the design thinking process?
  • Empathy
  • Ideation
  • Prototyping
  • Implementation

Module Quiz: Project Functionality

1. Suppose a server retrieves the following JSON result. Which of the following structs will be required to decode this into a Swift proper format?
{
 "list": [
   {
    "name": "Greek Salad",
    "price": "12.99",
    "description": "Our delicious salad is served with Feta cheese and peeled cucumber. Includes tomatoes, onions, olives, salt and oregano in the ingredients."
   },
   {
    "name": "Bruschetta",
    "price": "7.99",
    "description": "Delicious grilled bread rubbed with garlic and topped with olive oil and salt. Our Bruschetta includes tomato and cheese."
   },
   {
    "name": "Grilled Fish",
    "price": "20.00",
    "description": "Fantastic grilled fish seasoned with salt."
   }
 ]
}

struct JSONMenu: Codable {
   let list: [FoodItem]
}
struct FoodItem: Codable {
   let name: String
   let price: String
   let description: String
}

struct ListMenu: Codable {
   let list: [FoodItem]
}
struct FoodItem: Codable {
   let name: String
   let price: String
   let dishDescription: String
}

 struct JSONMenu:: Codable {
   let list: [FoodItems]
}
struct FoodItem: Codable {
   let name: String
   let price: String
   let dishDescription: String
}
2. Which of the following best describes what is happening in this code in relation to MenuItems?
static func createDishesFrom(menuItems: [MenuItem], _ context: NSManagedObjectContext) {
   for menuItem in menuItems {
    guard let _ = exists(name: menuItem.title, context) else {
    continue
    }
    let oneDish = Dish(context: context)
    oneDish.name = menuItem.title
    if let price = Float(menuItem.price) {
    oneDish.price = price
    }
    oneDish.dishDescription = menuItem.description
    oneDish.image = menuItem.image
   }
}
  • This code uses an array of MenuItems to create Dish objects in the Dish entity. The properties of the Dish objects are populated with the corresponding values from the MenuItems.
  • This code takes the entity of MenuItems and creates dishes in the Dish array populating them with properties from the MenuItems.
  • This code takes the object of MenuItems and creates dishes in the Dish array populating them with properties from the MenuItems.
  • This code will not run since there is a syntax error.
3. Which of the following options correctly demonstrate the use of NSPredicate class to retrieve entries containing the term "Éclair" in their names, while ignoring case and foreign characters? The entries are written in French and have their first letter capitalized in their names. Select all that apply.
  • NSPredicate(format: "%K CONTAINS[cd] %@", "name", "ECLAIR")
  • NSPredicate(format: "name CONTAINS[cd] %@", "eclair")
  • NSPredicate(format: "name CONTAINS %@", "eclair")
  • NSPredicate(format: "name == %@", "Éclair")
4. Which of the following code blocks is correct for fetching from a Dish entity without sorting or filtering?
@FetchRequest(
    sortDescriptors: [],
    predicate: NSPredicate(value: true),
    animation: .default
)
private var dishes: FetchedResults<Dish>

@FetchRequest(
    sortDescriptors: [],
    predicate: NSPredicate(),
    animation: .default
)
private var dishes: FetchedResults<Dish>

@FetchRequest(
    sortDescriptors: [value: true],
    predicate: NSPredicate(),
    animation: .default
)
private var dishes: FetchedResults<Dishes> 
5. Which is the correct predicate to filter by name in alphabetical order and case sensitive?
NSSortDescriptor(
    key: "name",
    ascending: true,
    selector: #selector(NSString.localizedCompare)
)

NSSortDescriptor(
    key: "name",
    ascending: true,
    selector: #selector(NSString.localizedCaseInsensitiveCompare)
)

NSSortDescriptor(
    key: "name",
    ascending: false,
    selector: #selector(NSString.localizedCompare)
6. Which of the following best describes what is happening in this line of code?
let predicate1 = NSPredicate(format: "fullName CONTAINS[d] %@", "Jane Doe")
  • This line of code creates a case sensitive predicate that searches for objects whose fullName property contains the string "Jane Doe" using the %@ placeholder to pass "Jane Doe" as an argument.
  • This line of code creates a case sensitive predicate that searches for objects whose fullName property contains the string "Jane Doe" using the %@ placeholder to pass "Jane Doe" as an parameter.
  • This line of code creates a case insensitive predicate that searches for objects whose fullName property contains the string "Jane Doe" using the %@ placeholder to pass "Jane Doe" as an argument.
7. Which NSPredicate format correctly filters entities based on the productPrice and customerName properties?
  • NSPredicate(format: "(productPrice < %@) AND (customerName CONTAINS[cd] %@)", price, partialName)
  • NSPredicate(format: "(%K < %@) AND (customerName CONTAINS[cd] %@)", "productPrice", price, partialName)
  • NSPredicate(format: "(%K < %@) AND (customerName CONTAINS[cd] %@)", productPrice, price, partialName)
8. Please describe what the following code does:
  • NSPredicate(format: "title CONTAINS %@", searchText)
  • It creates an NSPredicate that filters objects with a title property containing the text string specified by the searchText parameter.
  • It creates an NSPredicate that filters objects with a title property that is an exact match for the searchText parameter.
  • It creates an NSPredicate that filters objects with a non empty title property.
9. What is the role of NSManagedObjectContext in the following code sample?
static func createDishesFrom(menuItems: [MenuItem], _ context: NSManagedObjectContext) {
   for menuItem in menuItems {
    guard let _ = exists(name: menuItem.title, context) else { continue }
    let oneDish = Dish()
    oneDish.name = menuItem.title
    if let price = Float(menuItem.price) {
    oneDish.price = price
    }
    oneDish.dishDscription = menuItem.description
    oneDish.image = menuItem.image
   }
}
  • To oversee the generation and adjustment of MenuItem instances according to Dish objects.
  • To manage the creation and modification of MenuItem objects based on Dish objects. 
  • To manage the creation and modification of Dish objects based on MenuItem objects. 
10. Which of the following statements describes a benefit of using NSManagedObject?
  • NSManagedObject simplifies the process of setting up a persistent store coordinator. 
  • NSManagedObject automatically generates a user interface for your data model. 
  • NSManagedObject automatically handles memory management for your managed objects.
  • NSManagedObject simplifies the process for simple operations saving time for typing.


Final Graded Quiz

1. Which of the following statements about constants and variables are true? Select all that apply.
  • They can be printed on the console by using the following command:
print(myVariable)
  • A Float variable can be converted to String by using one of the following:
let myString = String(myFloat)
let myString = "\(myFloat)"
let myString = myFloat.description
  • Constants are defined once and cannot be changed. Variables can be changed at any time.
  • Variables are defined by the keyword var and constants are defined by the const keyword.
2. What is true of the following code? Select all that apply:
var firstValue = 10
firstValue += 500
  • It is replacing the contents of firstValue with 500.
  • It adds 500 to firstValue and assigns the result to firstValue.
  • It is equal to firstValue = firstValue + 500.
3. Which of the following is correct for performing operations between two data types?
  • let x = 5
    let y: Float = 8.1
    let result = x + y
  • let x = 5
    let y: Double = 8.1
    let result = x + y
  • let x = 5
    let y = 8.1
    let result = Double(x) + y
4. What results will the following code produce?
let quote = "Little Lemon"
let result1 = quote.hasPrefix("L")
let result2 = quote.hasSuffix("eon")
  • result1 equal to false and result2 equal to true.
  • result1 and result2 equal to true.
  • result1 equal to true and result2 equal to false.
  • result1 and result2 equal to false.
5. What will the following code output to the console?
let levelScore = 10
let score = "THE GAME'S SCORE IS "
var gameScore = 30
gameScore += levelScore
print(score.lowercased().count + gameScore)
  • 59
  • 30
  • THEGAME'SSCOREIS 30
  • THEGAME'SSCOREIS 59
6. What will be the value of the variable result in the following code?
let value1 = (19 % 6) * 3
let value2 = 77 % 10
let result = (value1 < 5) && (value2 > 10)
  • 3
  • true
  • false
  • 7
7. True or false: A compound predicate is used to combine multiple predicates.
  • True
  • False
8. Which of the following statements are true for a NSSortPredicate? Select all that apply:
  • They can be combined by using a NSCompoundSortDescriptor.
  • They can treat foreign characters like regular ones.
  • They can be combined by using an array.
9. Which git command will show you the current state of the local working directory?
  • git diff
  • git pull
  • git status
10. Which of the following statements is true about spacing input fields?
  • Spacing input fields helps the user identify labels that refer to input. 
  • Spacing input fields hinders the user's ability to identify labels that refer to input. 
  • It increases the amount of information that can be included on the form.
11. What is the purpose of a user journey map in the design process?
  • A user journey map is a document that outlines the technical specifications of a product or service.
  • A user journey map is a marketing tool used to promote a product or service.
  • A user journey map helps the designer empathize with the user by uncovering moments of frustration and satisfaction in a series of interactions.
  • A user journey map is a tool used to provide step by step instructions for users to follow.
12. What is one of the critical factors in usability and learnability for UI design?
  • Interface controls
  • Animations
  • Consistency
  • Design patterns
13. What does the sortDescriptors property do in the @FetchRequest declaration shown in the code example below?
@FetchRequest(
        sortDescriptors: AAA,
        predicate: BBB,
        animation: .default)
    private var dishes: FetchedResults<Dessert>
  • sortDescriptors specifies the filter for the fetched results.
  • sortDescriptors specifies the animation to use for the fetched results.
  • sortDescriptors specify the entity for the fetched results.
  • sortDescriptors specifies the sort order for the fetched results.
14. What is the benefit of creating a wireframe for a product?
  • A wireframe is used to test the product's usability. 
  • A wireframe provides a polished and final representation of the product's design. 
  • A wireframe is used to finalize the branding and typography of the product. 
  • A wireframe helps to identify the placement of content and functionality on the screen, the navigation flow, and user interactions. 
15. What is Git used for?
  • Git is a centralized version control system for team collaboration.
  • Git is a project management tool used for tracking support tickets and bug tracking.
  • Git is a web based platform that provides version control and collaborative software development services.
  • Git is a popular distributed version control system used for team collaboration.
16. What is the purpose of the getMenuData method created in the Little Lemon food ordering application?
  • To parse the response data for the menu data.
  • To initialize Core Data.
  • To create the models necessary to map the JSON.
  • To fetch the menu data from the server.
17. For the Home screen on the Little Lemon application, what should be done after initializing the persistence constant in the Home screen file?
  • Call the getMenuData method.
  • Create the models necessary to map the JSON.
  • Fetch the menu data from the server.
  • Set up the managedObjectContext environment variable.
18. What is the purpose of using the @FetchRequest API in Core Data?
  • The @FetchRequest API is used to insert new data into Core Data.
  • The @FetchRequest API is used to delete data from Core Data.
  • The @FetchRequest API is used to update data in Core Data.
  • The @FetchRequest API is used to retrieve data from Core Data and allows for sorting and filtering of the data.
19. Which of the following code snippets returns an array of sort descriptors in Swift?
  • let sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]
  • let sortDescriptors = [SortDescriptor(key: "name", ascending: true)]
  • let sortDescriptor = SortDescriptor(key: "name", ascending: true)
    let sortDescriptors = [sortDescriptor]
20. What is the purpose of the buildPredicate function in relation to the FetchedObjects?
  • To return an NSPredicate that can be used to filter the results of the FetchedObjects.
  • To delete all FetchedObjects from the data store.
  • To update a specific property of all FetchedObjects in the data store.
  • To return a sorted list of FetchedObjects based on a given key.
21. How is the search field implemented in the Little Lemon food ordering app?
  • A new TextField is added above the FetchedObjects element.
  • A new table view is added to the Menu view.
  • A new button is added to the navigation bar.
  • A new view controller is added to the app.
22. How are images loaded in the Little Lemon application?
  • Asynchronously
  • Synchronously
  • By using a third party service to host and display the images.
  • By preloading all images when the app starts up.
23. What is a flowchart and how is it used in the Little Lemon food ordering app?
  • A flowchart is a type of menu that lists the available food items in the app, and it is used to help users navigate the menu.
  • A flowchart is a way to display nutritional information for the food items in the app, and it is used to help users make healthier choices.
  • A flowchart is a feature that allows users to order food in the app without having to navigate through multiple screens.
  • A flowchart is a chart that shows the steps involved in a process, such as the process of ordering food in the app.
24. What does the JSONMenu struct contain?
struct JSONMenu: Codable {
  let menu: [MenuItem]   
}
struct MenuItem: Codable {
  let name: String
  let price: Float
  let description: String
  let image: String
}
  • An array of MenuItem objects
  • An array of Float objects
  • A single MenuItem object
  • An array of String objects
25. What is NSManagedObjectContext used for in iOS development?
  • NSManagedObjectContext is used for managing a collection of managed objects, which represent objects stored in a persistent store.
  • NSManagedObjectContext is used for handling networking requests.
  • NSManagedObjectContext is used for displaying data in a table view.
  • NSManagedObjectContext is used for creating user interfaces.
26. How is Core Data different from a typical database management system?
  • Core Data can only be used for temporary data caching.
  • Core Data is designed only for simple data storage and retrieval.
  • Core Data is not just a database management system, but it's also deeply tied to the user interface.
  • Core Data is not compatible with any external database management systems.
27. What is the purpose of the FetchedObjects struct in the code example provided for displaying the food menu in a list?
NavigationView {
    FetchedObjects(
    predicate:buildPredicate(),
    sortDescriptors: buildSortDescriptors()) {
    (dishes: [Dish]) in
    List {
    ForEach(dishes, id:\.self) { dish in
        DisplayDish(dish)
        .onTapGesture {
        showAlert.toggle()
        }
    }
    }
    .searchable(text: $searchText,
        prompt: "search...")
        }
    }
  • To encode the data retrieved from the remote server into a suitable Swift format.
  • To convert the retrieved menu items into the format used by the Dish entity.
  • To replace @FetchRequest and use dynamic predicates and sort descriptors.
  • To store the data retrieved from the remote server in Core Data.
28. What is NSSortDescriptor in Swift, and how is it used?
  • NSSortDescriptor is an optional type in Swift that is used to indicate whether an array should be sorted or not.
  • NSSortDescriptor is a protocol in Swift that defines the required methods for sorting arrays.
  • NSSortDescriptor is a built in method in Swift used to sort arrays of primitive types.
  • NSSortDescriptor is a class in the Foundation framework in Swift used to describe how to sort data based on certain criteria.
29. Which UI element can help guide the user through the onboarding process and introduce them to the app's features?
  • Labels, buttons, progress bars, tooltips, and checklists
  • Images and videos
  • Graphs, charts, and tables
  • Fonts and colors
30. How does Navigation in SwiftUI help users during the onboarding flow?
  • Navigation in SwiftUI is useful for apps that have a lot of features and functions. 
  • Navigation in SwiftUI guides users through each step of the onboarding flow, helping them to complete the process easily and efficiently. 
  • Navigation in SwiftUI is useful for experienced users who already know how to navigate through the app. 

Related Articles

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.