UTS iOS Application Development: Command-line Calculator Project

Verified

Added on  2023/01/18

|5
|716
|43
Project
AI Summary
This document presents an individual programming project for an iOS application development course, focusing on creating a command-line calculator using Swift. The project emphasizes several key aspects of software development, including program design, array and string manipulation, command-line arguments, class and method creation in Swift, exception handling, and automated testing. The student's solution demonstrates the use of Swift for this type of application, highlighting its advantages such as reduced compilation time and improved execution. The project involves the implementation of arithmetic operations, error handling, and the use of recursion and iteration to solve mathematical expressions. The document also includes a discussion of command-line arguments, class structures, and the implementation of automated testing using Xcode. Furthermore, the document provides a bibliography of relevant sources. The project aims to demonstrate the student's competence in applying these skills within the context of iOS application development.
Document Page
Running head: COMMAND-LINE CALCULATOR
Individual programming project:
Command-line calculator
Name of the Student
Name of the University
Author’s Note
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1
COMMAND-LINE CALCULATOR
Program Design
The use of Swift is an odd choice for development of command line program since C language,
perl, Java or Ruby can be used as a traditional choice for the development of the calculator. But
the use of swift help in providing the following advantages:
Using it as the interpreted scripted language and compiles language for reducing the
compilation time and reducing the complexity of maintenance. It can thus help in
improving the execution time and create a bundle for selling to the public.
There is no need for switching the language and thus the programmer can improve the
skill while sticking to it.
The calculator is developed to work with integers and the different operators for performing
the different arithmetic operations.
Array and string manipulation
For the manipulation of string and array in command line the number operator is used for
the repetition of the sequence. The arrays are spliced and broken into sub strings for using the
substring separately. The syntax of the string used for the development of the calculator is kept
simple and readable for constructing it by passing arguments. For the development of the
program the calc file is imported and the programming is done to solve the expression that uses
the + and – operators. The validity of the command line argument is checked and a proper error
message is displayed and the program is exited. For performing the division, the outbound errors
are checked and a class is created for each of the problem domain.
Recursion and iteration is used for solving the problem of solving the expression using +
and – operators. The program is developed as the same file as calc given in the template and the
Document Page
2
COMMAND-LINE CALCULATOR
results are printed as a standard output and message are displayed according to it and standard
errors are also displayed.
Command line arguments
It is achieved with editing the schema and running the arguments.
Creating classes and methods in Swift
The class structure is used for defining the method of instance and encapsulating the
specific task to work with the intended functionality.
Exception Handling
Try is used for handling the exceptions and bringing the data to the application. There are
certain possibility that the data may not reach the application and this possibility is eliminated
with the implementation of APIs and building function in Json that throws the data by default.
The swift is familiar that the data might add error and thus a function is created that is used for
eliminating an event that does not throws any error in the project.
Automated testing
The testing is performed for checking the errors in the developed xcode and for the
testing of the application the device selected in Iphone 5 and all the possible path and
functionality is tested for finding the possible outcomes. Since it is a simple application the tests
are performed manually and for decreasing the likelihood for missing the outcomes decreases
gradually. The testing of the application can also help in reducing the bugs and make changes in
the codes for adding new feature and eliminating the bugs. The compatibility of the developed
Document Page
3
COMMAND-LINE CALCULATOR
application for different platform is also checked and the codes are documented for performing
the intended functionality.
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4
COMMAND-LINE CALCULATOR
Bibliography
Nolan, G. (2016). Agile Swift: Swift Programming Using Agile Tools and Techniques. Apress.
Nolan, G. (2017). Swift Unit Testing. In Agile Swift (pp. 25-60). Apress, Berkeley, CA.
Yamacli, S. (2016). Beginner's Guide to iOS 10 App Development Using Swift 3: Xcode, Swift
and App Design Fundamentals. CreateSpace Independent Publishing Platform.
Yamacli, S. (2017). Beginner's Guide to iOS 11 App Development Using Swift 4: Xcode, Swift
and App Design Fundamentals. CreateSpace Independent Publishing Platform.
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]