Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Example 2: Simple calculator and user interaction 'Not to mention commenting on the results / critical evaluation of the results () 3.1. (Script 1) You

image text in transcribedimage text in transcribed

Example 2: Simple calculator and user interaction 'Not to mention commenting on the results / critical evaluation of the results () 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 42 "operation" for the example execution parameters ( 4 and 2) it should return: - 42+6 - 42Nx2 - 42w*s8 - 42/"p+2 - 42NNN16

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