QUESTION 1
1. Which programming languages do not have iteration
statements and why?
Imperative programming languages
require recursion to do anything iteratively
Object-Oriented Programming
languages do not use iteration since functions operate over data
structures.
Functional programming languages
since they do not use variables and counting loops require
variables.
Functional programming languages do
not have variables and iteration requires variables to
operate.
QUESTION 2
1. One of the downsides of using expressions that
produce results other than true or false is
it hurts writability since we have
to write such long expressions.
it can cause side effects skewing
the results of the rest of the code
it is expensive to type-check
it hurts readability since it may
be confusion to know which route an execution will take.
QUESTION 3
1. In mixed-mode expressions for Java,
a narrowing conversion must be made
explicitly via casting
a widening conversion must be made
explicitly via casting
a narrowing conversion must be made
implicitly via coercion
a narrowing conversion must be made
explicitly via coercion
QUESTION 4
1. Which of the following is NOT a control flow
structure?
Assignment statement
selection statement
procedure call
conditional target
QUESTION 5
1. Why do many programming languages (like Java) have
break and continue but not goto?
break and continue are special
situation gotos which are easier to use than goto.
break and continue are special
situation gotos which provide most of the functionality necessary
without harming readability.
break and continue can be used just
like goto therefore goto is never necessary
break and continue provide the same
functionality without the overhead of goto
Answer 1:
Functional programming languages since they do not use variables
and counting loops require variables.
Answer 2:
it hurts readability since it may be confusion to know which route
an execution will take.
Answer 3: a narrowing conversion must be made explicitly via
casting
Answer 4: Assignment statement
Answer 5: break and continue provide the same functionality without the overhead of goto
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELP ME
IT IS VERY IMP FOR ME
Get Answers For Free
Most questions answered within 1 hours.