Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3.1. (Script 1) You are supposed to MODIFY example script provided in the Example 2 so that it would perform operations +, -, *, /

3.1. (Script 1) You are supposed to MODIFY example script provided in the Example 2 so that it would perform operations +, -, *, / (only the whole part of the division operation, ignore the reminder part) and ^ (power). When it comes to the first four operations, they are normally supported by let command or the other alternative ways of calculating numerical expressions mentioned in the lecture slides (and these are actually already programmed in the Example 2). However, the power operation will need to be implemented by you, probably in the form of some sort of loop operations (I am leaving this to you to decide). Once you write the script, you will be required to upload it to the scriptcheck.cms.gre.ac.uk system for test purposes. The marking system will assume that the script will be processing three command line parameters, one for the first argument of arithmetic operation, the second command line parameter for the second argument of the arithmetic operations and third parameter expressing the arithmetic operation to be processed. Your script will be executed from the command line, for example, in order to check if your solution is correct it might be executed as: scriptname 4 2 operation The scriptcheck system will check if you script returns appropriate results for each operation; for the example execution parameters (4 and 2) it should return:

4 2 + -> 6

4 2 - -> 2

4 2 * -> 8

4 2 / -> 2

4 2 ^ -> 16

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Using Language That Works

Answered: 1 week ago

Question

4. Are my sources relevant?

Answered: 1 week ago