Mobile App Dev 2021W: Assignment 1: Difference between revisions

From Soma-notes
No edit summary
No edit summary
Line 3: Line 3:
Please answer all of the following questions in the [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/templates/assign1-template.txt supplied template], all of which are based on the code in [[Mobile App Dev 2021W: Tutorial 2|Tutorial 2]].  Do not turn modified applications.  Instead, when answering code writing questions, include code snippets and explain how they should be used to modify the application.  Be sure to use complete sentences when answering.
Please answer all of the following questions in the [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/templates/assign1-template.txt supplied template], all of which are based on the code in [[Mobile App Dev 2021W: Tutorial 2|Tutorial 2]].  Do not turn modified applications.  Instead, when answering code writing questions, include code snippets and explain how they should be used to modify the application.  Be sure to use complete sentences when answering.


This assignment is due on February 5, 2021 by 11:59 PM.  Submit your answers via cuLearn.
''Be sure to list collaborators and outside sources that you used.''
 
This assignment is due on February 5, 2021 by 11:59 PM.  It has 15 points in three questions.  Submit your answers via cuLearn.


==Questions==
==Questions==

Revision as of 15:15, 27 January 2021

This assignment is still being finalized.

Please answer all of the following questions in the supplied template, all of which are based on the code in Tutorial 2. Do not turn modified applications. Instead, when answering code writing questions, include code snippets and explain how they should be used to modify the application. Be sure to use complete sentences when answering.

Be sure to list collaborators and outside sources that you used.

This assignment is due on February 5, 2021 by 11:59 PM. It has 15 points in three questions. Submit your answers via cuLearn.

Questions

  1. [2] Change the conversions in ContentView.swift so that just the result is displayed in bold (the number and the unit).
  2. [6] Change main.swift as follows:
    1. [1] Rewrite the for loop in lines 7-9 of getChoice() to use forEach().
    2. [1] Make getConversion follow function rather than closure syntax.
    3. [2] Remove the ! in line 23 and fix the code. If you add a conditional, be sure it has an else clause that does something sensible (other than nothing).
    4. [2] Make the program repeatedly request conversions. So, after choosing a type of conversion and entering a value, it again displays the menu. Add an option to the menu to quit, and this option should cause the program to terminate.
  3. [7] Change the conversions so they each have a default for the from value.
    1. [2] Change the Converter struct to take this default from value when constructed, and add a default value to each of the conversions.
    2. [1] Make it so that in ContentView.swift, when first displaying a conversion it displays the default value and what it converts to.
    3. [2] Add a message, displayed at a nice spacing belowe the conversion that says "Please enter your own number to convert." in italics. This message should only be shown when the default value is being converted. It should be in a separate view.
    4. [2] How quickly does the above message disappear when you enter a new number? When does your new view have to be run in order to make this happen when it does?