logo

Crowdly

Browser

Add to Chrome

Objektinis programavimas C++ (BIO+INFO, egzaminas)

Looking for Objektinis programavimas C++ (BIO+INFO, egzaminas) test answers and solutions? Browse our comprehensive collection of verified answers for Objektinis programavimas C++ (BIO+INFO, egzaminas) at emokymai.vu.lt.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Pretend you are a machine executing the code provided below, in the exact order that a machine would execute it. Assume the variables have the following values before starting: x = 1, y = 3. Track the use of the variable named y. Every time the variable is used as a left value (i.e. changed in memory), note (eg. write it on paper) the new value. Every time the variable is used as a right value (i.e. read from memory), note the (old) value. To provide an answer construct a string containing only digits and no spaces or other symbols, from the values you have written down, in that exact order.

for( ; 1; ) if (y < x++) break;

View this question

Let myText be the name of a character array (char []) containing the contents of a text string "I hope that you are doing well". 

Using the name myText, what expression would you write to access (represent, read of modify) the last letter 'o' in this current array?

Important: you do not need an expression to return a character in any string, just the expression to return the particular character in this particular string.

View this question

Let str be a string. Write an expression that returns an index of the first occurrence (assume there is one) of "hello" in str.

View this question

Pretend you are a machine executing the code provided below, in the exact order that a machine would execute it. Assume the variables have the following values before starting: x = 1, y = 3, z = 5. Track the use of the variable named z. Every time the variable is used as a left value (i.e. changed in memory), note (eg. write it on paper) the new value. Every time the variable is used as a right value (i.e. read from memory), note the (old) value. To provide an answer construct a string containing only digits and no spaces or other symbols, from the values you have written down, in that exact order.

while (x + 1 > 0) z = x--;

View this question

Pretend you are a machine executing the code provided below, in the exact order that a machine would execute it. Assume the variables have the following values before starting: y = 3, z = 5. Track the use of the variable named z. Every time the variable is used as a left value (i.e. changed in memory), note (eg. write it on paper) the new value. Every time the variable is used as a right value (i.e. read from memory), note the (old) value. To provide an answer construct a string containing only digits and no spaces or other symbols, from the values you have written down, in that exact order.

for (i = z; i > y; --i) z = z + y - i;

View this question
Assuming the definition of the class would be written in the form below ("..." means some code inside of the class, and brackets indicate the beginning and the ending), what could would you write to replace "?" if you were to define a class B that is a child of a class named C and a parent of class named A?

? { ... }  // Java version

? { ... }; // C++ version

View this question
What code would you write to declare a pointer/reference named p that can point to an object of the class named P, and would belong to an instance (as opposed to a class), and would not be accessible beyond the scope of the class?

View this question
What code would you write to declare an abstract method called f that is public, accepts no arguments and does not return anything?

View this question
What code would you write to declare a constant of type int named VALUE that would belong to the class (rather than an instance) and would be accessible to anyone using the class?

If required by the language, also initialize it to 0.

View this question

Want instant access to all verified answers on emokymai.vu.lt?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome