Question: Exercises Exercise 1 Consider an unknown language with a left-associative + op- erator that is overloaded to have the following types: int real->real t-sint, real*int-sreal,
Exercises Exercise 1 Consider an unknown language with a left-associative + op- erator that is overloaded to have the following types: int real->real t-sint, real*int-sreal, and real real->real. Suppose the vari- able i has type int and the variable r has type real. For each+ operator in each of the following expressions, say which type of + is used: a. i+r b. i+r+i Exercise 2 Most languages that allow overloading of function definitions have this restriction: they do not permit two definitions for the same function to differ only in the type of value returned. Ada does not have this restriction. That means
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
