Question

In: Computer Science

part a. In class we learned that the debugger, and _________ are effective in debugging C++...

part a. In class we learned that the debugger, and _________ are effective in debugging C++ programs.

a.

a logic analyzer

b.

print statements

c.

code reviews

d.

network analyzers

part b. A ‘side-effect’ is

a.

code written in a memory-efficient way

b.

a style of writing C++ statements that is risky.

c.

code written so that more than one thing is being done in one statement.

d.

(a) and (b)

e.

(b) and (c)

f.

none of the above

part c. All the bitwise operators we learned take two arguments, except for   &

True

False

part d. The following code fragment (assuming proper surrounding  main(), etc.):

{

        int i1;

     }

cout << i1 << endl;

a.

does not cause a compile-time error.

b.

causes a compile-time error, due to improper type usage

c.

causes a compile-time error, due to scoping issues

d.

causes a linker error

Solutions

Expert Solution

a)

Debugger, and a logic analyzer are effective in debugging.

Option a correct choice

A logic analyzer used in both

  • Develop logic circuits and
  • debug logic circuits

Logical analyzer runs in high speed

Logical analyzer in general used in the hardware engineers to do debug.

b)

A ‘side-effect’ is code written in a memory-efficient way.

Option a correct choice

In practical try to avoid the side-effect.

It causes effect on the parameter passed by reference so the modification values found.

It is also causes effect on Modification of I/O operations as well as global variable value.

c)

All the bitwise operators we learned take two arguments, except for &

False

Since bitwise & take two arguments like other operators.

Example:

1&1 = 1

d)

The scope of a variable is within the brackets.

We can not access the variable out of the brackets where it declare.

If we use the variable out of scope(out of the brackets) it rasise an compiler error.

Observe the code:

{

        int i1;

// i1 can accepted any where within the brackets

}

cout << i1 << endl; // Since i1 is out of scope it raises compile time error

Causes a compile-time error, due to scoping issues

Option c correct choice


Related Solutions

We have learned about conditioning in class. There are countless ways that we encounter condition in...
We have learned about conditioning in class. There are countless ways that we encounter condition in everyday life. This assignment requires that you examine conditioning (either classical or operant) as you’ve experienced it. Provide five examples of conditioning from your own life with a detailed description of stimulus/response and reinforcement patterns.​
In class, we learned that ”most” of the sun’s radiation happens in the band 0.2 ?...
In class, we learned that ”most” of the sun’s radiation happens in the band 0.2 ? ? ? 3µm, and Stephen asked what ”most” means. What proportion of solar radiation (for a black body sun) falls in the above wavelength range. Similarly, what proportion of the Earth’s radiation (black body Earth at 290K) occurs in the wavelength band 4 ? ? ? 40µm? What wavelength range contains the middle 95% of the sun’s radiation?
In class we learned that investors should always hold a portfolio that is on the efficient...
In class we learned that investors should always hold a portfolio that is on the efficient frontier. In reality investors often hold a portfolio that is not on the efficient frontier. One reason for this is called home bias. Home bias refers to the fact that investors tend to have larger portfolio weights on assets that are located in the country in which they live. So, American investors tend to have a larger portfolio weight on American firms than is...
In class, we learned that the running time of Karatsuba’s algorithm can be expressed as the...
In class, we learned that the running time of Karatsuba’s algorithm can be expressed as the recurrence T (n) = 3T (n/2) + n. We then used the substitution method to solve the recurrence. When using the substitution method, it seems difficult to make a guess about the upper bound on the running time. However, if we use the recursion tree method, it would be a lot easier. In this question, you are asked to solve this recurrence using the...
In class we learned that, if terms added in a series continually decrease in size, the...
In class we learned that, if terms added in a series continually decrease in size, the terms will eventually be too small to be stored by MATLAB. When a number is too small to be stored, we learned that such a situation is called underflow; in this case, MATLAB will just store it as 0. We also learned that a program computing such a series can terminate the loop when the next term to be added is equal to 0...
In C++ In this lab we will be creating a stack class and a queue class,...
In C++ In this lab we will be creating a stack class and a queue class, both with a hybrid method combining linked list and arrays in addition to the Stack methods(push, pop, peek, isEmpty, size, print) and Queue methods (enqueue, deque, peek, isEmpty, size, print). DO NOT USE ANY LIBRARY, implement each method from scratch. Both the Stack and Queue classes should be generic classes. Don't forget to comment your code.
1. We have learned in this class that the steady condition is given as: sf (k)...
1. We have learned in this class that the steady condition is given as: sf (k) = (n + S + g)k . Use this condition for steady state to find the steady state (long run) equilibrium values of capital per effective worker, k* , output per effective worker, y* ; consumption per effective worker, c* ; and investment per effective worker, i* , for this economy. 2. If the United States adopts policies that permanently decrease savings and investment,...
Insurance. As we learned this term, healthcare insurance is one example of an entire class of...
Insurance. As we learned this term, healthcare insurance is one example of an entire class of insurance products that is provided by the government. The government tends to underwrite insurance programs when they are at a high risk of failure, for whatever the reason. Carefully explain four reasons why the government underwrites healthcare insurance in the U.S. In your answer, use as many examples from the US healthcare industry as you can.
One of the lessons we have learned in class is that raising the minimum wage would...
One of the lessons we have learned in class is that raising the minimum wage would put more employment pressure on competitively disadvantaged, unskilled workers. Furthermore, many older Americans do not have enough savings or pension for them to retire. To help resolve this problem, the government has proposed that it will provide subsidies to companies hiring workers aged 65+. Given what you have learned about subsidies, who (employer or employee) in reality is receiving the subsidies? Start your analysis...
Analyze a real government policy in the context of the macroeconomic concepts we learned in class....
Analyze a real government policy in the context of the macroeconomic concepts we learned in class. Describe the economic problem this policy attempted to tackle and the intended macroeconomic goals.Explain who were the agents pushing this policy forward. Who opposed the policy? What was the incentive framework of the main agents involved before the policy was implemented? And what was the incentive framework implied by the policy? You must be able to identify groups of people with similar background or...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT