Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Let data be an array of int type, with size or capacity = 5. The value of data[3] after the following code executes is

2. Let data be an array of int type, with size or capacity = 5. The value of data[3] after the following code executes is _____. data[0] = 2; for (int i = 1; i < 5; i++) data[i] = data[i-1] + i; (Points : 1) 2 5 8 14

Question 3.3. What is the result of 32 % 3? (Points : 1) 0 1 2 3

Question 4.4. A return statement causes execution of a function or method to _____. (Points : 1) return to the top of the loop terminate and return to where the function or method was called terminate and halt the execution of a program return to the top of the function or method

Question 5.5. Consider the C++ class declaration class Circle { private: double radius; public: Circle(); Circle(double); void setRadius(double); double getRadius(); double volume(); void print(); }; How many constructors does the class have? (Points : 1) 0 2 4 6

Question 6.6. The value of variable y after the following switch statement executes is _____. int y = 2; switch(y) { case 1: y += 1; case 2: y += 2; case 3: y += 3; break; case 4: y += 4; break; case 5: y += 5; break; default: y = 0; } (Points : 1) 0 4 7 11

Question 7.7. Consider the Java class class MyNumberClass { private int number; public MyNumberClass() { number = 0; } public MyNumberClass(int n) { setNumber(n); } public void setNumber(int n) { number = n; } public int getNumber() { return number; } public int getSuccessor() { return number+1; } public int getPredecessor() { return number-1; } public void print() { System.out.println(number); } } What will the code below print? MyNumberClass x = new MyNumberClass(5); x.setNumber(x.getSuccessor() + x.getPredecessor()); x.print(); (Points : 1) 4 5 6 10

Question 8.8. What is the range of valid subscripts for the following array? double numbers[15]; (Points : 1) 1 to 14 1 to 15 0 to 14 0 to 15

Question 9.9. Which statement tests variable x to be in the range 10 to 20, inclusive? (Points : 1) if (10 <= x && <= 20) if (10 <= x <= 20) if (10 <= x || x <= 20) if (10 <= x && x <= 20)

Question 10.10. To indicate in an UML class diagram that a member is private, use the _____ sign in front of the member name. (Points : 1) + - # ->

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago