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
olga55 [171]
4 years ago
10

Consider a Rational class designed to represent rational numbers as a pair of ints, along with methods reduce (to reduce the rat

ional to simplest form), gcd (to find the greatest common divisor of two ints), as well as methods for addition, subtraction, multiplication, and division. Why should the reduce and gcd methods be declared to be private?
A. because they will never be used
B. because they will only be called from methods inside Rational
C. because they will only be called from the constructor of Rational
D. because they do not use any of the Rationalinstance data
E. This is incorrect; they should be declared as public
Computers and Technology
1 answer:
emmasim [6.3K]4 years ago
3 0

Answer:

Option B is the correct answer to the following question.

Explanation:

Because the data members and the member functions are declared with the private access modifier so they are unable to access from outside the class even they are the data members or the member functions. then, all the members of the class can only call through the other method of relational then, they has to be declared with the private access modifier.

You might be interested in
In two to three sentences, describe how you would move a file.
Nina [5.8K]
<span />


You can move the file one of two ways. Your first option is to click and drag the file to another folder in the Folders pane on the left side of the window. Your second option is to right-click the file and choose Send To. Then choose from the options shown in the submenu that appears.



3 0
3 years ago
Read 2 more answers
Q) Select the two obstacles for data parsing
fgiga [73]

Answer:

A and B

Explanation:

parsing with a rich grammar like TAG faces two main obstacles: low parsing speed and a lot of ambiguous syntactical parses.

3 0
4 years ago
Read 2 more answers
(2-2) In relatives.pl file, write and add the following rule. ancestor(X, Y) : X is an ancestor of Y Run ancestor(brown, X). Sub
alukav5142 [94]

Answer:

Check the explanation

Explanation:

relatives.pl

/* Facts */

male(ace).

male(john).

male(jack).

male(bill).

male(david).

male(brown).

male(daniel).

female(cecil).

female(aba).

female(cathy).

parent(john,ace)

parent(tom,john)

parent(jack,john)

parent(bill,aba)

parent(brown,aba)

parent(cecil,bill)

parent(david,cecil)

parent(cathy,brown)

parent(daniel,cathy)

parent(ellen,daniel)

/* parent(X,Y) -> Y is parent of X */

wife(ceceil,jack) /* wife(X,Y) -> Y is wife of X */

Answer of 2-2

Considering all facts and rules answer will be daniel,ellen.

Answer 2-3

Considering all facts and rules answer will be bill.

Answer 2-4

Considering all facts and rules X will be john and y will be cecil.

Answer 2-5

Considering all facts and rules X will be tom and y will be david.

4 0
3 years ago
The equivalent of the TTL field in an ipv4 header is known as the ___an IPv6 header
OLga [1]
<span>The equivalent of the TTL(Time to Live) field in an IPv4 header is known as the Hop Limit in an IPv6 header.
</span>The IPv6 header is a streamlined version of the IPv4 header. The field Hop Limit has the size of 8 bits and indicates the maximum number of links over which the IPv6 packet can travel before being discarded.
7 0
3 years ago
Write a "while" loop equivalentto the following "for" loop: (2Points)
kap26 [50]

Answer:

int i,t = 0;

   i=0;  //initialize

   while(i<22){

       t = t + i;

           cout << t;

           i += 3;   //increment

   }

   cout << endl;

Explanation:

Loops are used to execute the part of the code again and again until the condition is not true.

In the programming, there are three loop

1. for loop

2. while loop

3. do-while loop

The syntax of for loop:

for(initialize; condition; increment/decrement){

   statement;

}

The syntax of while loop:

initialize;

while(condition){

   increment/decrement;

}

In the while, we change the location of initializing which comes before the start of while loop, then condition and inside the loop increment/decrement.  

6 0
4 years ago
Other questions:
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • You can change the color of the value of a cell or the background color of the cell but not both.
    5·2 answers
  • Which of the following is something you need to keep an eye out for
    7·2 answers
  • The _____ element of the wsdl describes the data being exchanged between the web service providers and the consumers, including
    12·1 answer
  • Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item
    9·1 answer
  • You are a cleared employee. Your friend called and told you that he saw information about the classified XYZ program on the Inte
    10·1 answer
  • WHY IS BRAINLY NOTIFICATIONS LIKE THIS?????
    15·2 answers
  • .Choose the extention of Scratch Project<br><br><br> .sb2<br><br> jpeg<br><br> .exls
    5·2 answers
  • The person that includes the most and funniest memes (screenshot from the web) gets brainliest.
    5·1 answer
  • What is a computer? ​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!