Modify ContractorCalculator (Chapter 10, exercise 5) to display the tax rate. Use two labels: one to display the text “
Tax
Rate” and the other to display the current tax rate. Add a button “Change Rate” that will open a view controller that allows the user to enter the tax rate. Save the tax rate in a UserDefaults object. When the dialog is closed, the new tax rate should be displayed in the
Label
. The app should use this rat for calculations until it is changed. The tax rate be loaded from the UserDefaults anytime the app opens.
A Reminder – This app supposed to be created in XCODE/SWIFT in iOS for iPhone
Chapter10 exercise 5 is below Create a ios project called ContractorCalculator with iOS navigation and interface design
The view controller layout should contain two text fields, one button, and eight labels (Figure 10.27).
Tax
Total:
LabelLabelLabel
The Calculate button should add the labor and material costs from Figure 10.27 ContractorCalculator the textfields and put the result in the label next to Sub total. Lax should be calculated using a 5% rate (use a constant) and displayed in the label next to Tax. The tax and subtotal should be added together and displayed in the label next to Total.