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
Paha777 [63]
3 years ago
8

If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following

correctly sets oddNum to true if Person object r has an odd number of children and to false otherwise?
oddNum = ( ( r.numChildren() % 2 ) != 0 );

if ( ( r.numChildren() % 2 ) == 0 )

oddNum = false;

else

oddNum = true;

oddNum = false;

for ( int k = 0 ; k < r.numChildren() ; k++ )

oddNum = !oddNum;

I only

II only

III only

I and II only

I, II, and III
Computers and Technology
1 answer:
cricket20 [7]3 years ago
4 0

Answer:

I, II, and III

Explanation:

The three are almost saying the same thing. the loop is one am a bit concerned about. but since the oddnum is set to false, the loop will work.

The one and two are pretty clear. to test for odd number, the easiest is to divide by two to see if there will be a remainder. That is what both first and second statement is trying to do.

You might be interested in
The way that text and images are arranged on a slide is called _________. A. Layout B. Background C. Style D. Charting
Mademuasel [1]
It is called a layout.
8 0
3 years ago
Read 2 more answers
A broker statement is an example of an ___ record
VARVARA [1.3K]

Answer: investment

Explanation:

3 0
3 years ago
Read 2 more answers
1. which of the following tools can be used to mesure mass. (answer = 5 +??? points)
krek1111 [17]
B. a triple-beam balance
4 0
3 years ago
Read 2 more answers
"what windows process is responsible for authenticating users?"
Likurg_2 [28]
Lsass.exe /................................................
8 0
3 years ago
When working in Excel Online, what is it called when you drag the fill handle down to copy data?
SVEN [57.7K]
It’s called drag fill
5 0
3 years ago
Read 2 more answers
Other questions:
  • Lucky Sevens. Given a whole number, compute and display how many digits in the number are 7s. For example, the number of 7s in 3
    8·1 answer
  • Why are coders using encoder software? What are their advantages and disadvantages? And when might a coder need to use the codin
    12·1 answer
  • g Define memory hierarchy. A. The rate at which information can be transferred from one place to another. B. Ordering storage sy
    8·1 answer
  • Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
    13·1 answer
  • NEED FIVE QUESTIONS ANSWERED!!!
    7·1 answer
  • What programming language does the LMC 'understand'?
    5·1 answer
  • Answer for 5,6,7 any one know plz
    8·1 answer
  • You use a Windows desktop system to edit and produce audio files. Your system has two hard disks installed. Your applications ar
    10·1 answer
  • I just wanna know how many times a day y'all hit the tutor button at the bottom
    10·2 answers
  • Animals living in burrows under the ground is an interaction between the biosphere and the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!