Preview

Computer Programming: Questions on C++

Satisfactory Essays
Open Document
Open Document
1368 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer Programming: Questions on C++
7. For the following code, which statement is not true? public class Sphere
{
private double radius; public double x; private double y; private double z;
}
a.x is available to code that is written outside the Sphere class. b.radius is not available to code written outside the Sphere class. c.radius, x, y, and z are called members of the Sphere class. d.z is available to code that is written outside the Sphere class.

ANS: D

8. Which of the following is not part of the method header?
a.Method name
b.Return type
c.Access specifier
d.Parameter variable declaration
e.All of the above are parts of the method header

ANS: E

7. For the following code, which statement is not true? public class Sphere
{
private double radius; public double x; private double y; private double z;
}
a.x is available to code that is written outside the Sphere class. b.radius is not available to code written outside the Sphere class. c.radius, x, y, and z are called members of the Sphere class. d.z is available to code that is written outside the Sphere class.

ANS: D

8. Which of the following is not part of the method header?
a.Method name
b.Return type
c.Access specifier
d.Parameter variable declaration
e.All of the above are parts of the method header

ANS: E

7. For the following code, which statement is not true? public class Sphere
{
private double radius; public double x; private double y; private double z;
}
a.x is available to code that is written outside the Sphere class. b.radius is not available to code written outside the Sphere class. c.radius, x, y, and z are called members of the Sphere class. d.z is available to code that is written outside the Sphere class.

ANS: D

8. Which of the following is not part of the method header?
a.Method name
b.Return type
c.Access specifier
d.Parameter variable declaration
e.All of the above are parts of the method header

ANS: E

7. For the following code, which statement is not

You May Also Find These Documents Helpful