1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
3 years ago
13

Assume that the following code exists inside a method of MyClass, and that this code compiles without errors: int result = book.

getYearPublished();where book is an object of the Book class.Which of the following is not true about the getYearPublished method?(1 point)I. It is a mutator method.II. It is a public method in the Book class.III. It returns a String.1) I only2) II only3) III only4) I and II only5) I and III only
Computers and Technology
1 answer:
kicyunya [14]3 years ago
3 0

Answer:

Option (5)

Explanation:

Since, it is returning a value which is stored in a variable result which is of int type, that is why, III is wrong as it cannot return a string. Moreover, A mutator method is one which changes the value of a private member of a class and they don't return anything of any type. But the statement is returning a value of int type so, it cannot be a mutator method. So, I and III are not true. Since, object of book class is able to access that method , it must be a public method otherwise error would have displayed as objects of class has no access to their private members and can invoke public member functions only. So, II is true.

You might be interested in
This is for C++: Using a nested for loop output the following pattern to the screen:
olga55 [171]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int r=26,x,y;//defining integer variable  

char c;//defining a character variable

for(x= 1; y<= r; x++)//using for loop for count value

{

for(y= 1; y<= x; y++)//using for loop to convert value in triangle  

{

c=(char)(y+64);//convert value into character  

cout << c;//print character value

}

cout << "\n";//use print method for line break

}

return 0;

}

Output:

Please find the attachment file.

Explanation:

In this code, three integer variable "x,y, and r", and one character variable "c" is declared, that is used in the nested for loop,  in the first for loop it counts the character value and in the next for loop, it converts the value into a triangle and uses the char variable to print its character value.

3 0
2 years ago
¿Cuáles son las dos ideas que confrontan en la "Revolución Tecnológica", cuando se refieren a la producción?
jeyben [28]

Answer:

._.  dont know spanish

Explanation:

6 0
3 years ago
Marta is creating a program that will guide the user through a series of physical exercises. She wants the program to coach the
san4es73 [151]
She should use a condition-controlled loop. Because it uses a True/False and it will not continue until the task is done
7 0
2 years ago
Read 2 more answers
Simplify the Boolean expression (AB(C + BD) + AB]CD.
finlep [7]

Explanation:

Simplify the Boolean expression (AB(C + BD) + AB]CD.

6 0
3 years ago
Read 2 more answers
Local laws passed councils are called
anzhelika [568]
An ordinance is the name typically used for a law passed by a local political subdivision, such as a city, county, village, or town. Ordinances may address a wide variety of local issues, from local government structure to speed limits and sign sizes.
4 0
3 years ago
Other questions:
  • Word offers a multitude of picture formatting options that allow you to flip, rotate, and make many other adjustments to inserte
    15·1 answer
  • Browsing the web is one of the most common activities performed by individuals who use computers.
    12·1 answer
  • 2 ways to assign a value to a variable
    6·1 answer
  • Most people entering the construction industry learn a specific craft through:
    14·2 answers
  • Number 20, can anyone help?
    11·1 answer
  • Define a class named ComparableSquare that extends Square (defined above) and implements Comparable. Implement the compareTo met
    7·1 answer
  • What is the multiple source test
    15·1 answer
  • Why is it so important to adhere to principles that have been put forth by reputable organizations to ensure that you are mainta
    10·1 answer
  • Kyra is teaching a photography class. She would like her students to share photos. She would also like the students to be able t
    6·1 answer
  • Describe accessibility in Windows 7 ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!