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
Furkat [3]
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:
Nikolay [14]3 years ago
3 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
What effects will the different types of lighting produce on mountains?
bonufazy [111]
Once enough charge has been separated in a growing storm, a lightning flash can occur. These normally travel within or between clouds (abbreviated CC) or from cloud to ground (CG). Most storms produce more CC than CG flashes--about six times as many in tropical storms and two times as many in midlatitudes. Sometimes a flash will travel from cloud to air or simply occur within "clear" air.

Exactly what triggers flashes is still uncertain and an area of continued research. It seems that very concentrated electric fields (perhaps at the ends of pointed surfaces or single particles) are needed to accelerate charged particles, or ions. Once moving with sufficient energy, the ions appear to blaze a path toward opposite charge in cascading fashion.

3 0
3 years ago
How would a barcode reader be used in a healthcare industry?​
Leto [7]

Answer:

As you know the on going situation we are in, barcodes can be really useful for an example using them to check into a building that way when there is a infected person it is a really esay process to track down people that have been in that area.

5 0
3 years ago
Choose the best answer in each of the drop-down menus.
Ivanshal [37]

Answer:

whata r in the windows pls list them

Explanation:

3 0
3 years ago
Which of the following statements is NOT true about a mainframe computer?
Savatey [412]

Answer:

C - A single computer with a single user is typical of a mainframe computer.

Explanation:

Mainframes are a type of computer that generally are known for their large size, amount of storage, processing power and high level of reliability. They are primarily used by large organizations for mission-critical applications requiring high volumes of data processing. In general, there are a few characteristics of mainframes that are common among all mainframe vendors: Nearly all mainframes have the ability to run (or host) multiple operating systems. Mainframes can add or hot swap system capacity without disruption. Mainframes are designed to handle very high volume input and output (I/O) and emphasize throughput computing. A single mainframe can replace dozens or even hundreds of smaller servers.

8 0
4 years ago
Julian downloaded some of the music he created to play for his friend. Julian's friend wore headphones to listen to the music. A
Alexxx [7]

Answer: An output device

Explanation:

Headphones are the hardware output device and it use in the purpose of listening audio and music and watching movies without any interruption and distributing others.

It can used in the computer system by plugging it in or connecting it with the speakers.

We can connect headphones to the computer system which basically result in output as sound in the headphones and then it is not needed to use USB headphones.

4 0
3 years ago
Read 2 more answers
Other questions:
  • What has prompted schools to add Internet activities in their academic integrity policies?
    6·2 answers
  • 1. Explain what is meant by the following data types:
    11·1 answer
  • ) Suppose algorithm A takes 10 seconds to handle a data set of 1000 records. Suppose the algorithm A is of complexity O(n2). Ans
    12·1 answer
  • While recording a voice, if the narration is large,it is better to make a :a)a linked object b)an embedded object c)none d)does
    14·1 answer
  • after clicking the start button on your computer screen desktop what option would you then select to examine systems components
    6·1 answer
  • 50) Universal Containers has an integration that runs nightly to update the Product (Product2) object in Salesforce with updated
    9·1 answer
  • Someone receives and email that appears to be from their bank requesting them to verify account information, this type of attack
    10·1 answer
  • It is desirable to provide a degree of __________ __________ among classes so that one class is not adversely affected by anothe
    8·1 answer
  • PLSS HELP ASAP ILL GIVE BRAINLIEST THANKS
    11·1 answer
  • Bunco is a dice throwing game that requires no decisions to be made or skill on the part of the player just luck. In the simples
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!