Question: Considering the operator definition: [ 5 * 2 pts = 1 0 pts ] name ( inputl type, input 2 t y p e ,

Considering the operator definition:
[5*2pts =10 pts]
name(inputl type, input2 t y p e ,...) output_type
You are given the following operators:
+(float, float) float (addition)
*int, int) int (multiplication)
/(int, int) int (integer division)
>(int, int) boolean (greater than)
!(boolean) boolean (logical NOT)
||(boolean, boolean) boolean (logical OR)
==(float, float) boolean (equality for floats)
Note: Operator: +(float, float) float, means it takes two floats, performs an add opera-
tion on them, and outputs a float.
Using the given operators, decide whether the following expressions ((a) to (e)) are ty-
peable or not. If the expression is typeable (able to be reduced to a typed expression), give
its type and expected output. Otherwise, give an explanation of why it is not typeable.
1.!(5>3)
2.100/ x; given x = "twenty"
3.45.0+19.0
4.45*(3>2)
5.99.0==(50.0+49.0)

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 Programming Questions!