Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 1 . a . Define operator precedence and operator associativity. b . What is a ternary operator? What is a prefix operator? c .

Q1.
a. Define operator precedence and operator associativity.
b. What is a ternary operator? What is a prefix operator?
c. What is a coercion?
d. In JavaScript, what is the difference between == and ===?
e. What is a mixed-mode expression?
f. What is short-circuit evaluation?
Q2. Let the function fun be defined as
int fun (int ?**k){
+k+=4;
return 3+(+k)-1;
}
Suppose fun is used in a program as follows:
void main (){
int i=10,j=10, sum1, sum2;
sum1=(i2)+fun(&i);
??2=fun(j)+(j2);
}
What are the values of sum 1 and sum 2
operands in the expressions are evaluated left to right?
operands in the expressions are evaluated right to left?
Q3.
a. Determine whether the narrowing explicit type conversions in two languages you know provide
error messages when a converted value loses its usefulness.
b. What is a pretest loop statement? What is a posttest loop statement?
c. What is unusual about Python's design of compound statements?
d. What does the range function in Python do?
Q4. Rewrite the following pseudocode segment using a loop structure in the
specified languages:
k=j+1327
loop:
if k>10 then goto out
k=k+1
i=3+k-1
goto loop
out: ...
C,C++, Java, or C#
Python
Assume all variables are integer type. Discuss which language, for this code, has the best writability, the
best readability, and the best combination of the two.
image text in transcribed

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

1. Practice giving the test before you actually use it.

Answered: 1 week ago