Question: create a simple command - line program in Swift programming language that uses the basic math rules. All the numbers are of Int type. You

create a simple command-line program in Swift programming language that uses the basic math rules. All the numbers are of Int type.
You are to prepare a macoS command-line tool that will act as a simple calculator. The
calculator will be run from the command line and will only work with integer numbers and the
following arithmetic operators: +-x8?(8). The operator is the modulus operator, not
percentage.
For example, if the program is compiled to
, the following demonstrates how it will work
In the command line, the arguments are a repeated sequence in the form
[number operator ...]
and ending in a
number
Hitting the enter key will cause the program to evaluate the arguments and print the result. In
this case
The program must follow the usual rules of arithmetic which say:
The x and operators must all be evaluated before the + and operators.
Operators must be evaluated from left to right.
For example, using Rule 1
2+43-6
becomes
2+12-6
which results in
with the given code main and calculator and if needed others (exmaple operatortree)
 create a simple command-line program in Swift programming language that uses

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!