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
A company was asked to develop a smartphone app to help people locate a car of their choice to purchase from a complex of more t
daser333 [38]

Answer:

the gps and a map

Explanation:

3 0
3 years ago
Read 2 more answers
1.11 LAB: Data frames
grigory [225]

To work with data frames in python, the pandas library ls very efficient. Therefore, the following lines of code will <em>load, subset and display the maximum value</em> of each column in the subset :

import pandas as pd

<em>#This</em><em> </em><em>imports</em><em> </em><em>the</em><em> </em><em>pandas</em><em> </em><em>dataframe</em><em> </em><em>and</em><em> </em><em>alias</em><em> </em><em>it</em><em> </em><em>as</em><em> </em><em>pd</em><em> </em>

df_cars = pd.DataFrame('Cars.csv')

<u>Subsetting the firsts UserNum row</u> :

Using the index location method, the first userNum row has a row index of 0.

df_subset = df.iloc[:0, :]

<em>#this</em><em> </em><em>selects</em><em> </em><em>only</em><em> </em><em>the</em><em> </em><em>first</em><em> </em><em>row</em><em> </em><em>and</em><em> </em><em>all</em><em> </em><em>the</em><em> </em><em>columns</em><em> </em>

<em>#first</em><em> </em><em>row</em><em> </em><em>of</em><em> </em><em> </em><em>df_cars</em><em> </em><em>dataframe</em><em> </em><em>has</em><em> </em><em>been</em><em> </em><em>assigned</em><em> </em><em>to</em><em> </em><em>another</em><em> </em><em>dataframe</em><em> </em><em>called</em><em> </em><em>the</em><em> </em><em>df_subset</em>

df_subset.max()

<em>#the</em><em> </em><em>max</em><em> </em><em>function</em><em> </em><em>returns</em><em> </em><em>the</em><em> </em><em>maximum</em><em> </em><em>value</em><em> </em><em>for</em><em> </em><em>each</em><em> </em><em>column</em><em> </em>

<em>Note</em><em> </em><em>:</em><em> </em><em>the</em><em> </em><em>cars.csv</em><em> </em><em>data</em><em> </em><em>wasn't</em><em> </em><em>provided</em><em>,</em><em> </em><em>However</em><em>,</em><em> </em><em>this</em><em> </em><em>is a</em><em> </em><em>run-through</em><em> </em><em>of</em><em> </em><em>how</em><em> </em><em>to</em><em> </em><em>get</em><em> </em><em>the</em><em> </em><em>required</em><em> </em><em>output</em><em>.</em><em> </em>

Learn more :brainly.com/question/16183131?referrer=searchResults

4 0
3 years ago
In Unified Modeling Language (UML) Class diagrams, a Class is represented by a rectangle. True or False True False
Dennis_Churaev [7]

Answer:

or

Explanation: idk

6 0
4 years ago
By applying styles, _______ formats are being applied each time. A. various B. different C. the same D. similar
Dmitry [639]
I just took the test on (PF) it's C. the same

i hope this helped someone.
;-)
4 0
4 years ago
Read 2 more answers
Which dhcp client option is used to provide a list of domain names to use in name resolution queries?
Rama09 [41]
Name resolution is done using DNS servers. DHCP provides a client with a list of DNS servers via option 6, "DNS Server".
4 0
4 years ago
Other questions:
  • Describe a situation where it would be appropriate to use each of the six leadership styles described by Daniel Goleman
    7·1 answer
  • Hich of the following usually indicates that there is no moreinput to be read by a program?
    14·1 answer
  • Which of the following best characterizes the state of programming languages over time? They increase in popularity as more prod
    10·1 answer
  • An array of Strings, names, has been declared and initialized. Write the statements needed to determine whether any of the array
    9·1 answer
  • Steve is creating a document with proper nouns, which Word continues to identify as being misspelled.
    10·1 answer
  • What should you do before using a website to store student information ? A. Read and understand the website’s privacy contract
    11·2 answers
  • 1. Text that is located between and appears in the browser's
    13·1 answer
  • True or False: Variablename must start with a number.
    13·1 answer
  • What is a current trend in ERP systems?
    12·1 answer
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!