Consider a Rational class designed to represent rational numbers as a pair of int's, along with methods reduce (to reduce the rational to simplest form), gcd (to find the greatest common divisor of two int's), as well as methods for addition, subtraction, multiplication, and division. Why should the reduce and gcd methods be declared to be private.

Answers

Answer 1

Answer:

There is not a reason for the two methods to be private unless you want to only allow objects of the class Rational to have access to these methods.  Perhaps your professor has a particular reason for requiring it to be set up as such.

Explanation:

The use of the private space simply restricts access to either variables or methods contained within the space to the class object that is associated with the variable or methods.

The use of the public space allows the method or variable to be accessed from anywhere within the program.

Note, if using class inheritance, classes that inherit from the Rational class will not be able to access the private functions.


Related Questions

William plans to write a paper about computers. He wants to compare desktop and laptop computers. He is trying to decide how to use cubing to refine his topic. Which is an example of how cubing can be used to refine William’s topic? It can be used to write a thesis statement explaining the computer types being compared. It can be used to write a list of the levels and sublevels of the features of a laptop computer. It can be used to analyze and describe possible uses of each type of computer. It can be used to make a map showing all of the types of desktop computers.

Answers

Answer:

c) It can be used to analyze and describe possible uses of each type of computer.

Explanation:

I just did it on edge 100%

good luck

Answer:

c) It can be used to analyze and describe possible uses of each type of computer.

Explanation:

just did dis on edge hope dat helpssssssssss :)

Gregor installed a third stick of known-good RAM into his Core i7 system, bringing the total amount of RAM up to 3 GB. Within a few days, though, he started having random lockups and reboots, especially when doing memory intensive tasks such as gaming. What is most likely the problem

Answers

Answer:

The speed or quality was different.

Explanation:

The new ram that he installed most likely had a different rate, or was a different quality than the old ram.

The ___________ button represents the start of a hyperlink in Table of contents.

Answers

Answer:

An LS button

Explanation:

It appears on the (structure line 3)on the structure line, place your cursor in the white field to the right of the E button (Recall that the E button represent the entry test).

Varun wants to start his own business. Suggest him at least four functions of an entrepreneur.

Answers

Answer:

Creates innovation

Takes and makes decision

Organizing resources

Takes and bears risks

Answer:

FOUR THINGS ARE DOWN

Explanation:

● Creates innovation

● Takes and makes decision

● Organizing resources

● Takes and bears risks

Given the variable ip, already declared as a pointer to an integer, write the code to dynamically allocate memory for a single integer value, assign the resulting pointer to ip, and initialize the integer value to 27.

Answers

Answer:

In C++:

int *ip;

ip = new int;

*ip = 27;

Explanation:

First of all, let us have a look at the methods of memory allocation to a variable.

1. Compile Time: The memory gets allocated to the variable at the time of compilation of code only. It is also called static allocation of memory.

Code example:

int a = 5;

2. Run Time: The memory is allocated to the variable on the fly i.e. during the execution of the program. It is also called dynamic allocation of memory.

Now, we have to write code for a variable ip, which is an integer pointer to dynamically allocate memory for a single integer value and then initialize the integer value 27 to it.

Initializing a variable means assigning a value to variable for the first time.

Writing the code in C++ programming language:

int *ip;      // Declaring the variable ip as a pointer to an integer

ip = new int;    // Dynamically allocating memory for a single integer value

*ip = 27;   // Initializing the integer value to 27.

A systems administrator is designing a directory architecture to support Linux servers using Lightweight Directory Access Protocol (LDAP). The directory needs to be able to make changes to directory objects securely. Which of these common operations supports these requirements?

Answers

The options available are:

Search, modify.

StartTLS, delete.

Bind, modify.

Bind, add.

Answer:

StartTLS, delete

Explanation:

StartTLS is a computer networking term for email protocol command, in which a system administrator buses it to command an email server that an email client running in a web browser, wants to turn an existing insecure connection into a secure one. Thus, during this process, StartTLS permits a client to communicate securely using LDAPv3 over TLS.

On the other hand, the DELETE operation can make a change to a directory object.

According to the given question, the common operations that supports requirements where directory needs to be able to make changes to directory objects securely are;

Bind, addSearch, modifyBind, modifyStartTLS, delet

According to the question, we are to discuss the common operations that supports some requirements as regards the changing of directory objects securely.

As a result of this we can see that making use of  StartTLS, delete can serve this purpose and other function as well.

Therefore, common operations that supports requirements where directory needs to be able to make changes to directory objects securely is Search and modify.

Learn more about directory architecture at:

https://brainly.com/question/13171394

Justify the statement "The same job title can have different job roles and different qualification criteria in different organizations." Compare job titles and their respective roles and qualifications from at least two organizations in different industries, and write a short essay explaining your reasoning.

Answers

Answer:

Below is an executive summary of this particular issue.

Explanation:

Each organization has differential requirements and preferences. This same employment opportunities rely heavily on either the structure of the company and indeed the amount of equipment that it possesses. Hence, whenever they recruit an individual on a specific job, their work description can differ based on the organization's needs including growth.

Answer:

In the classified section of a local newspaper, I came across job openings for the post of a network engineer in two different companies. One was from the airline industry, while the other was from the food and beverage industry.

The airline company required an applicant to have a bachelor's degree in network administration. The job posting specified that applicants with supporting CCENT or CompTIA Security+ certifications would be preferred. The company was willing to consider candidates with no prior experience. The job responsibilities included: maintaining security, DNS, IP routing, firewalls, and troubleshooting IT-related problems. The role also required skills to manage multi-site network operations, operating systems, and other software applications in public as well as private facilities. Another responsibility was to complete the time logs in the company's records to facilitate timely and accurate billing.

For the role of a network engineer in the food and beverage industry, the required qualification was any bachelor's degree in computer science with a minimum of one year of relevant experience. Certifications were an added advantage, but they were not a necessity. The job role required skills to troubleshoot network glitches, monitor network usage, install software and hardware infrastructure, provide technical assistance to users, and suggest improvements in the system.

Explanation:

RSA is a public-key cryptosystem developed by MIT professors Ronald L. Rivest, Adi Shamir, and Leonard M. Adleman in 1977 in an effort to help ensure Internet security. RSA uses modular arithmetic and elementary number theory to do computations using two very large prime numbers. Identify the statement which is true for RC6 algorithm:________.
a) Is a variable key-size stream cipher with byte-oriented operations and is based on the use of a random permutation
b) Includes integer multiplication and the use of four 4-bit working registers
c) Is a parameterized algorithm with a variable block size, key size, and a variable number of rounds
d) Is a 64 bit block cipher that uses a key length that can vary between 32 and 448 bits

Answers

The answer is B) includes integer multiplication and the use of four 4-but working registers

Which of the following is true? a. Pseudocode is used to describe an algorithm. b. Pseudocode is not an actual computer programming language. c. Pseudocode is used to describe executable statements that will eventually be translated by the programmer into a program. d. All of the above.

Answers

Answer:

Correct answer is:

d. All of the above

Explanation:

First of all, let us learn about a pseudo code:

Pseudo code: It is an implementation of any algorithm written with the help of annotations and text using in simple English. (So, point a. is true)

It is written in English so its syntax is not like any actual programming language. (So, point b. is true)

Pseudo code describes what each line of pseudo code will do so the code writing becomes easier simply by translating the pseudo code to actual programming language syntax i.e. point c. is true.

Hence, point "d. All of the above" is true.

Advantages of Pseudo code :

It makes the readability of the program idea/approach better.Code writing becomes easier for the programmer.

Correct answer is:

d. All of the above

What is the best offline route navigation app for Android?

Answers

Answer:

Google Maps

Explanation:

Answer:

Sygic GPS Navigation & Maps

Explanation:

As important as it is to plan ahead, sometimes you _____. A. Need to throw all the rules of the road out the window B. Can't stop things from going wrong C. Have a higher priority than driving safely D. Will regret having made plans

Answers

Answer:

B

Explanation:

This seems the most appropriate..

You use a cisco 2900 router in your network. you are considering purchasing and implementing the Unifield communications feature set on this router. however, you would like to evaluatie this feature set for a period of time prior to pruchasing it whcih command activate the evaluation right to use license for this feature set?

Answers

Explanation:

License boot module c2900, technology-package uck9

Pre-made, copyright-free illustrations are called __________. apps clip art graphic design stock photos

Answers

Answer: clip art

Explanation:

The clip arts are graphic images that are pre-made illustrations for the purpose of creating any medium (designs or art). It has no restrictions to use them, it can be used by anyone, hence its copyright-free.It comes in both electronic and printed form.But mostly they are designed and distributed and used by a person in an electronic form.

Hence, the complete statement is "Pre-made, copyright-free illustrations are called clip art".

Answer:

B) clip art

Explanation:

I got this question correct

what is a good wall adapter for your house?​

Answers

Answer:

RAVPower Dual-Port*

Explanation:

HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical controls D. Administrative, technical, and physical controls

Answers

Answer:

D

Explanation:

Based on HIPAA Privacy Rule requires that covered entities apply appropriate administrative, technical, and physical safeguards to protect the privacy of protected health information, in any form.

why is know app downloading in my android phone even if I have 900 MB ???

Answers

Answer:

May be you have not signed in with Google

Perhaps you are stopping the downloading without knowing

You asked your colleague to provide feedback on a blog post you recently wrote. When they sent you their feedback, they made edits directly in the doc. Is this a best practice for a content editing process?

Answers

Explanation:

This question can have both answers that is yes as well as no.

1.Yes, it can serve as an editor who completes your content and ensures it will read well to others.

2. No, the editor should have tracked changes which would have shown you where they would apply recommended edits.

Write the steps to create labels in OpenOffice writer

Answers

1. Start up Open Office.Org.

2. Click on File >> New >> Labels.

3. In the label dialog box, click on the brand box. This will allow you to choose the type of paper that you use.

4. Select the type of document that you want. The usual standard is Avery, but feel free to explore and discover what you like.

5. Select if you want a single label, a document, and any other options. Some of the things you might want to do are:

- Create a variety of labels for folders or drawers

- Create a sheet of address labels

-  Create decorative labels

6. Click New Document. Here, you see a sheet of blank labels.

7. Create the type of format/placement that you want for your labels. Once you are happy with it, copy it to the rest of the labels.

8. Fill your labels with necessary information.

9. Print them out.

Eliza needs to share contact information with another user, but she wants to include only certain information in the

contact. What is the easiest way for her to achieve this?


A. Use the Edit Business Card dialog box to control the information included.

B. Export only select fields from the contact.

C. Save the contact as a VCF file.

D. Share your contacts foler with other user.

Answers

Answer:

A. Use the Edit Business Card dialog box to control the information included.

Explanation:

b was incorrect but A is correct on edge 2020 I did the unit test review

Using the Edit Business Card dialog box to control the information included is the easiest way for her to achieve this. Thus option A is correct.

What is information?

Knowledge acquired by study, discussion, research, or education is referred to as information. Data is, in essence, the outcome of the data analysis and interpretation process. Info is the interpretation of those elements of knowledge, whereas data is the particular measurements, figures, or diagrams.

She can do this most easily while using the Edit Business Card Combobox to modify the material included. When you get a new email, a meeting submission, or a task plea, a notification called a pc alert flashes up on your computer. Desktop Alerts are on by default.

Depending on the product on the content you get in your Outlook, a Desktop Alert may or may not display certain information. Therefore, option A is the correct option.

Learn more about information, Here:

https://brainly.com/question/13629038

#SPJ5

You are a technician working for a large company and you notice a user has left a Post-it note attached to her monitor of a new password that she was just given. What should the technician do

Answers

Explanation:

When you notice that  a user has left a Post-it note attached to her monitor of a new password that she was just given, you should immediately inform this to your senior authority. As this is potent sign of virus or malware threat to the system.

What kind of attack allows for the construction of LDAP statements based on user input statements, which can then be used to access the LDAP database or modify the database's information? a. LDAP poisoning b. LDAP injection c. Kerberos injection d. DAP hijacking

Answers

Answer:   b. LDAP injection

Explanation:

LDAP (Lightweight Directory Access Protocol ) Injection is defined as

an injection attack used by attacker to exploit web based applications by inserting LDAP statements based on user input. It may be possible modify LDAP statements through some techniques if an application fails to properly sanitize user input.

So, LDAP injection is the attack that allows for the construction of LDAP statements based on user input statements, which can then be used to access the LDAP database or modify the database's information.

Hence, the correct option is b. LDAP injection.

Answer:

dap

Explanation:

you suck 1v1 me epic Jayden rock star

if a person walks 10 metres due to south in 10 seconds 10 due east in the next 10 seconds and transmitted you're not in the next 10 seconds then he has Dash velocity​

Answers

Answer:

[tex]\frac{1}{3}\ m/s[/tex]

Explanation:

The computation of the velocity by using the following formula is

As we know that

[tex]Velocity = \frac{Displacement}{Total\ time\ taken}[/tex]

where,

Displacement is 10 meters

Total time taken is 30 seconds

Now placing these values to the above formula

So, the velocity of Dash is

[tex]= \frac{10\ meters}{30\ seconds}[/tex]

[tex]= \frac{1}{3}\ m/s[/tex]

We simply applied the above formula so that we can get the velocity and the same is to be considered

You are on a committee tasked with researching and recommending a service that will allow employees the opportunity to save files from their mobile phones, laptop computers, and workstation computers to cloud file storage services.
Which of the following will need to be researched and considered in order to make a comprehensive recommendation?
a. Virtualization application streaming
b. Off-site email applications
c. Type 2 hypervisor application
d. Type 1 hypervisor
e. Synchronization apps

Answers

Answer:

e. Synchronization apps

Explanation:

The synchronization refers to the process in which a user keeps his or her data in a multiple-way i.e in different applications so that the chances of loss of data could be minimized. And at the same time,  it also maintains the data integrity

It can be done by entering your credentials so that it appears as displayed before

Therefore according to the question, for saving the files from mobile phones, laptop computers, etc for cloud storage services the best and appropriate option is synchronization applications.

A technician is troubleshooting a Windows computer experiencing slow startup. Which of the following steps should the technician take first to determine whether startup processes are responsible for the slow startup?
A. The technician should permanently disable all startup processes in System Configuration.
B. The technician should measure the time it takes to start the system using a normal boot and compare that time against the time it takes for the system to perform a clean boot.
C. The technician should back up user data and reinstall Windows and all applications.
D. The technician should disable all scheduled tasks in Task Scheduler and reboot the system.

Answers

Answer:

The correct option is;

The technician should measure the time it takes to start the system using a normal boot and compare that time against the time for the system to perform a clean boot.

Explanation:

Clean boot is the process of starting the Windows operating system where the number of drivers as well as startup programs enabled are minimal in order to ascertain if the cause of a slow system startup is due startup interfering programs or drivers

A clean boot operating system startup and a startup in Safe Mode are similar with the difference being the higher level of control on what to run during start up offered by clean boot to aid troubleshooting startup issues.

What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible by ten: " + counter); counter++; } else { System.out.println("Counter is not divisible by ten: " + counter); counter++; } Move the duplicated code outside of the if statement Shorten variable names Move the brackets to save several lines of code Add semicolons after the if condition and the else reserved word

Answers

Answer:

Move the duplicated code outside of the if statement

Which of the following is a valid constructor header for the Player class that accepts the player name as a parameter? public void Player(String playerName) private Player(playerName) private void Player(playerName) public Player(String playerName)

Answers

Answer: Player(String playerName)

Explanation:

A constructor is a code block of a class. It is always witnessed when a new instance of the class is created

In JAVA , a valid constructor header is given as " CLASS (parameter)"

here, Class  → Player

parameter →  player name  (which is a string)

So, a valid constructor header for the Player class that accepts the player name as a parameter: Player(String playerName)

ment best describes the relationship between superclass and subclass types? a. A subclass reference cannot be assigned to a superclass variable and a superclass reference cannot be assigned to a subclass variable. b. A subclass reference can be assigned to a superclass variable and a superclass reference can be assigned to a subclass variable. c. A superclass reference can be assigned to a subclass variable, but a subclass reference cannot be assigned to a superclass variable. d. A subclass reference can be assigned to a superclass variable, but a superclass reference cannot be assigned to a subclass variable.

Answers

Answer:

d. A subclass reference can be assigned to a superclass variable, but a superclass reference cannot be assigned to a subclass variable.

Explanation:

A subclass is a class which is derived from another class. A subclass will have the characteristics of its ancestor class. A superclass is a class which is class direct ancestor. A superclass is an existing class from which new classes are derived whereas subclass is a class which is derived from superclass. The correct statement is that a subclass can be assigned to a superclass variable.

Escribe todas las posibles combinaciones que pueden haber entre 4 bits.

Answers

Answer:

The answer is "[tex]\bold{2^n\ \ _{where} \ \ \ n \ is\ bit }[/tex]"

Explanation:

The Combinations could be produced by using n-bits [tex]2^n[/tex] . It s enables you to generate the 4-bit numbers that are:

[tex]\to 2^4 = 16[/tex] combinations.

for the 4-bit, the combination of 2 = 16, which are its possible combination and for the   10 variations  appropriate 16 combinations are used,  As we know for 4 bit 16 Combinations can be generated which are from 0 to 15.

Consider the following code snippet. File hoursFile = new File("hoursWorked.txt"); Your program must read the contents of this file using a Scanner object. Which of the following is the correct syntax for doing this? Scanner in = new Scanner("hoursWorked.txt"); Scanner in = new Scanner(hoursFile); Scanner in = Scanner.open(hoursFile); Scanner in = Scanner("hoursWorked.txt");

Answers

Answer:

Scanner in = new Scanner(hoursFile);

Explanation:

The syntax to read the content of a file after the file has been created/initialized is as follows;

Scanner [variable-name] = new Scanner([object-name]);

From the question above, the [object-name] is hoursFile

Substitute [object-name] with hoursFile, the syntax becomes

Scanner [variable-name] = new Scanner(hoursFile);

[variable-name] can be anything as long as it follows variable naming convention;

From the list of given options, the option that answers the question is: Scanner in = new Scanner(hoursFile);

Which statement is false?It's necessary to include names of pointer arguments in function prototypes.A function receiving an address as an argument must define a pointer parameter to receive the address.The compiler does not distinguish between a function that receives a pointer and a function that receives a single-subscripted array.The function must â knowâ whether it is receiving a sin-gle-subscripted array or simply a single variable for which it is to perform simulated call by reference.

Answers

Answer:

The answer is "It's necessary to include names of pointer arguments in function prototypes".

Explanation:  

In method prototype, the declaration of the method specifics name and type of methods like arity, parameter type, and return type, but omits the method body, and the correct choices can be defined as follows:

A method which gets an address of the parameter must fix a pointer parameter for all the address to be received. The code compiler doesn't differentiate the received method and a  single subscribe array reference or function. Its function should "know" how a single sub-scripted array has been received for which simulated references are required.
Other Questions
When do we use v=2s/t and what does that equation mean? Find the slope of the line that contains (6, 2) and (6,-3).Find the slope of the line through the points (-4,-7) and (4, 3). 8. Which of the following prohibits association between church and government?O The Church and State ClauseO Free Exercise ClauseO Necessary and Proper ClauseEstablishment Clause Rachel made $110 for 5 hours of work. At the same rate, how many hours would she have to work to make $264 ? Read this statement: The primary goal of the business firm is to maximize the wealth of the firm's owners. For a corporation, this statement means that managers should focus on maximizing the wealth of its shareholders or its: You want to install a 1 yd. Wide walk around a circular swimming pool. The diameter of the pool is 23 yd. What is the area of the walk? Use 3.14 for pi . The areas of the squares adjacent to two sides of a right triangle are shown below Which polynomial is equivalent to (2h 3k)(h + 5k)? The principal P is borrowed at a simple interest rate r for a period of time t. Find the simple interest owed for the use of the money. Assume there are 360 days in a year. P = $7000, r = 0.2%, t = 6months Orlandos business wants to enact an affirrimative action plan which of the following would not be a part of the process find the equation of a circle which passes through the point (2,-2) and (3,4) and whose centre lies on the line x+y=2 Find the volume of the given solid region in the first octant bounded by the plane 9z+15y+15z=45 and the coordinate planes, using triple integrals. Determine whether the data set is a population or a sample. Explain your reasoning. The salary of each teacher in a school. Choose the correct answer below. A. Sample, because it is a collection of salaries for all teachers in the school comma but there are other schools. B. Population, because it is a subset of all schools in the city. C. Sample, because it is a collection of salaries for some teachers in the school. nothing D. Population, because it is a collection of salaries for all teachers in the school. What is the midpoint of the line segment with endpoints (3.5, 2.2) and (1.5, -4.8) The goal of collaborative planning, forecasting, and replenishment (CPFR) is to improve operational efficiency and manage inventory.a. Trueb. False 5 (x+4)=35.please solve it for me What's the answer to this question? Two ballpoint pens are selected at random from a box that contains3 blue pens, 2 red pensand 3 green pens. If X is the number of blue pens Una persona lanza una pelota hacia arriba con una velocidad de 15 metros por segundo. - Calcule: o Altura mxima que alcanza la pelota o Tiempo en el aire. The___is the fluid component of blood.