Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or intersect. The method accepts the coordinates of the center of the first circle and its radius, and the coordinates of the center of the second circle and its radius.

The header of the method is as follows:

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2)


Hint:

Distance between centers C1 and C2 is calculated as follows:
d = Math.sqrt((x1 - x2)2 + (y1 - y2)2).

There are three conditions that arise:

1. If d == r1 + r2
Circles touch each other.
2. If d > r1 + r2
Circles do not touch each other.
3. If d < r1 + r2
Circles intersect.

Answers

Answer 1

Answer:

The method is as follows:

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2){

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

    if(d == r1 + r2){

        System.out.print("The circles touch each other");     }

    else if(d > r1 + r2){

        System.out.print("The circles do not touch each other");     }

    else{

        System.out.print("The circles intersect");     }

}

Explanation:

This defines the method

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2){

This calculate the distance

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

If the distance equals the sum of both radii, then the circles touch one another

    if(d == r1 + r2){

        System.out.print("The circles touch each other");     }

If the distance is greater than the sum of both radii, then the circles do not touch one another

   else if(d > r1 + r2){

        System.out.print("The circles do not touch each other");     }

If the distance is less than the sum of both radii, then the circles intersect

   else{

        System.out.print("The circles intersect");     }

}


Related Questions

While saving a document to her hard drive, Connie's computer screen suddenly changed to display an error message on a blue background. The error code indicated that there was a problem with her computer's RAM. Connie's computer is affected by a(n) __________.

Answers

Answer:

The right answer is "Hardware crash".

Explanation:

According to the runtime error message, this same RAM on your machine was problematic. This excludes file interoperability or compliance problems as well as program error possibilities.Assuming implementation performance problems exist, the timeframe that would save the information would be typically longer, but there's still a lower possibility that the adequacy and effectiveness color will become blue but instead demonstrate warning would appear.

Thus the above is the right solution.

What do application in productivity suites have in common

Answers

Answer:

The function of the suites application is to create presentations and perform numerical calculations.

Explanation:

Use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume that there are two directories, d1 and d2, and there are different files in each one of them. Also, each file contains a short-length string of characters. You have to use a parent process that forks two children processes, and have each child process check one of the directories.

Answers

Answer:

Yup

Explanation:

Ten examples of an interpreter

Answers

Answer:

Some popular examples of today's interpreters are:

Interpreter of PythonInterpreter for RubyPerl performerInterpreter for PHPMATLAB UCSD Pascal

Explanation:

An interpreter executes the commands directly in an object code or a machine code, written in a program or a scripting language.

The Interpreter can be referred to as system software that can read and execute the programme instead of interpreting programmes. This interpretation includes high-level source code, pre-compiled programmes and scripts.

It is important to note that the interpreter translates programme by programme line, meaning that one statement is translated on one go. This feature makes it easy for programmers to check any line on debugging but slows the whole programme running time.

Heinrich Koch is a second-year college student. Last semester his best friend had his laptop stolen. The laptop was an old computer that he planned to replace soon, but the greatest loss was his data: he had not performed a backup and all his data was lost. Heinrich himself does not perform data backups but knows that he needs to do that on a regular basis. He has decided to use an online backup service that will automatically back up his data whenever it changes. Evaluate and compare reviews of online backup services. Consider iDrive, Carbonite, Acronis True Image, BackBlaze, and others you might find in your research. Recommend a service that you consider the best solution for Heinrich. Discuss your reviews and mention speed, security, and features in your recommendation.

Answers

Answer:

Acronis True Image is the one I would recommend out of these mentioned online backup services.

Explanation:

The evaluations and reviews of each of the online backup services are as follows:

a. iDrive

For this, we have:

Speed = 60% - fair

Security = 100% - excellent

Privacy = 88% - very good

Features = 95% - excellent

Pricing = 85% - Very good

Because of its various features, pricing, and usability, IDrive reviews suggest that it is a very efficient online backup solution. However, there have been complaints concerning its speed and the fact that there are no monthly plans available.

b. Carbonite

For this, we have:

Speed = 60% - fair

Security = 100% - excellent

Privacy = 87% - very good

Pricing = 85% - very good

File backup and restoration = 75% - good

Carbonite reviews reveal that it is simple to use and provides limitless backup for one device. The main drawback is that it has extremely poor backup speeds.

c. Acronis True Image

This is fast, simple and intuitive

It has complete control over the backup updates, including how and when they occur.

It is not expensive.

Acrnonis True image is a powerful backup storage service. It enables data and file backup and restoration from USB drives.

Many reviewers of Acrnonis True image have stated that they have had no issues with its service, that it is worth purchasing, and that there are no concerns.

d. Backblaze

For this, we have:

Speed = 75% - good

Security = 75% - good

Privacy = 70% - decent

Pricing = 100% - excellent

Support = 95% - excellent

Features = 65% - decent

File back-up and restoration = 70% - decent

Backblaze is one of the most popular internet backup services. This storage service, however, does not allow for ustomization.

Recommendation

Acronis True Image is the one I would recommend out of these mentioned online backup services. This is due to the fact that it delivers a large amount of accurate and high-quality data storage. It is quick, simple and intuitive, which is what most people care about. Furthermore, reviewers have stated that this service is quite effective and that there have been very few issues with it. The other services demonstrate that their services have flaws, such as lack of customization and slowness.

The _________ attack exploits the common use of a modular exponentiation algorithm in RSA encryption and decryption, but can be adapted to work with any implementation that does not run in fixed time.
A. mathematical.
B. timing.
C. chosen ciphertext.
D. brute-force.

Answers

Answer:

chosen ciphertext

Explanation:

Chosen ciphertext attack is a scenario in which the attacker has the ability to choose ciphertexts C i and to view their corresponding decryptions – plaintexts P i . It is essentially the same scenario as a chosen plaintext attack but applied to a decryption function, instead of the encryption function.

Cyber attack usually associated with obtaining decryption keys that do not run in fixed time is called the chosen ciphertext attack.

Theae kind of attack is usually performed through gathering of decryption codes or key which are associated to certain cipher texts

The attacker would then use the gathered patterns and information to obtain the decryption key to the selected or chosen ciphertext.

Hence, chosen ciphertext attempts the use of modular exponentiation.

Learn more : https://brainly.com/question/14826269

Given two regular expressions r1 and r2, construct a decision procedure to determine whether the language of r1 is contained in the language r2; that is, the language of r1 is a subset of the language of r2.

Answers

Answer:

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

Explanation:

An algorithm must be guaranteed to halt after a finite number of steps.

Each step of the algorithm must be well specified (deterministic rather than non-deterministic).

Three basic problems:

Given an FA M and an input x, does M accept x?

Is x in L(M)

Given an FA M, is there a string that it accepts?

Is L(M) the empty set?

Given an FA M, is L(M) finite?

Algorithm for determining if M accepts x.

Simply execute M on x.

Output yes if we end up at an accepting state.

This algorithm clearly halts after a finite number of steps, and it is well specified.

This algorithm is also clearly correct.

Testing if L(M) is empty.

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if all strings are rejected.

The "algorithm" is well specified, and it is also clearly correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we use the algorithm for the first problem as a subroutine; you must think in this fashion to solve the problems we will ask.

Correct Algorithm

Simulate M on all strings of length between 0 and n-1 where M has n states.

Output no if and only if all strings are rejected.

Otherwise output yes.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts any strings, it must accept one of length at most n-1.

Suppose this is not true; that is, L(M) is not empty but the shortest string accepted by M has a length of at least n.

Let x be the shortest string accepted by M where |x| > n-1.

Using the Pumping Lemma, we know that there must be a "loop" in x which can be pumped 0 times to create a shorter string in L.

This is a contradiction and the result follows.

COMMENT: There are more efficient algorithms, but we won't get into that.

Testing if L(M) is finite

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if there are a finite number of yes answers.

This "algorithm" is well specified and correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we again use the algorithm for the first problem as a subroutine.

Correct Algorithm

Simulate M on all strings of length between n and 2n-1 where M has n states.

Output yes if and only if no string is accepted.

Otherwise output no.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts an infinite number of strings, it must accept one of length between n and 2n-1.

This builds on the idea that if M accepts an infinite number of strings, there must be a "loop" that can be pumped.

This loop must have length at most n.

When we pump it 0 times, we have a string of length less than n.

When we pump it once, we increase the length of the string by at most n so we cannot exceed 2n-1. The problem is we might not exceed n-1 yet.

The key is we can keep pumping it and at some point, its length must exceed n-1, and in the step it does, it cannot jump past 2n-1 since the size of the loop is at most n.

 This proof is not totally correct, but it captures the key idea.

COMMENT: There again are more efficient algorithms, but we won't get into that.

   Other problems we can solve using these basic algorithms (and other algorithms we've seen earlier this chapter) as subroutines.

       COMMENT: many of these algorithms depend on your understanding of basic set operations such as set complement, set difference, set union, etc.

Given a regular expression r, is Lr finite?

Convert r to an equivalent FA M.

COMMENT: note we use the two algorithms for converting a regular expression to an NFA and then an NFA to an FA.

Test if L(M) is finite.

Output the answer to the above test.

Given two FAs M1 and M2, is L(M1) = L(M2)?

Construct FA M1-2 from M1 and M2 which recognizes the language L(>M1) - L(>M2).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

How are dates and times stored by Excel?​

Answers

Answer:

Regardless of how you have formatted a cell to display a date or time, Excel always internally stores dates And times the same way. Excel stores dates and times as a number representing the number of days since 1900-Jan-0, plus a fractional portion of a 24 hour day: ddddd. tttttt

Explanation:

mark me as BRAINLIEST

follow me

carry on learning

100 %sure

Dates are stored as numbers in Excel and count the number of days since January 0, 1900. Times are handled internally as numbers between 0 and 1. To clearly see this, change the number format of cell A1, B1 and C1 to General. Note: apparently, 42544 days after January 0, 1900 is the same as June 23, 2016

Design a class named Employee. The class should keep the following information in member variables:
Employee name
Employee number
Hire Date
Write one or more constructors and the appropriate accessor and mutator functions for the class.
Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information:
Shift (an integer)
Hourly pay rate (a double)
The workday is divided into two shifts: day and night. The shift variable will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write one or more constructors and the appropriate accessor and mutator functions for the class. Demonstrate the classes by writing a program that uses a ProductionWorker object."
Now I have written out the program, it compiles without errors. However, when I run it It asks the first question "Employees name" after input it errors and closes itself down. Can anyone find where in my code it is causing it to do this please? To be clear, I am not asking for someone to write the program, I have already done this, just need to know why it compiles but does not run all the way through. Thank You!
#include
#include
#include
using namespace std;
class Employee
{
private:
string employeeName;
int employeeNumber;
int hireDate;
public:
void setemployeeName(string employeeName);
void setemployeeNumber(int);
void sethireDate(int);
string getemployeeName() const;
int getemployeeNumber() const;
int gethireDate() const;
Employee();
{

Answers

Answer:

Here is the code.

Explanation:

#include <iostream>

#include <cstdlib>

#include <string>

#include <iomanip>

using namespace std;

class Employee

{

private:

string employeeName;

int employeeNumber;

int hireDate;

public:

void setemployeeName(string employeeName);

void setemployeeNumber(int);

void sethireDate(int);

string getemployeeName() const;

int getemployeeNumber() const;

int gethireDate() const;

Employee();

};

void Employee::setemployeeName(string employeeName)

{

employeeName = employeeName;

}

void Employee::setemployeeNumber(int b)

{

employeeNumber = b;

}

void Employee::sethireDate(int d)

{

hireDate = d;

}

string Employee::getemployeeName() const

{

return employeeName;

}

int Employee::getemployeeNumber() const

{

return employeeNumber;

}

int Employee::gethireDate() const

{

return hireDate;

}

Employee::Employee()

{

cout << "Please answer some questions about your employees, ";

}

class ProductionWorker :public Employee

{

private:

int Shift;

double hourlyPay;

public:

void setShift(int);

void sethourlyPay(double);

int getShift() const;

double gethourlyPay() const;

ProductionWorker();

};

void ProductionWorker::setShift(int s)

{

Shift = s;

}

void ProductionWorker::sethourlyPay(double p)

{

hourlyPay = p;

}

int ProductionWorker::getShift() const

{

return Shift;

}

double ProductionWorker::gethourlyPay() const

{

return hourlyPay;

}

ProductionWorker::ProductionWorker()

{

cout << "Your responses will be displayed after all data has been received. "<<endl;

}

int main()

{

ProductionWorker info;

string name;

int num;

int date;

int shift;

double pay;

cout << "Please enter employee name: ";

cin >> name;

cout << "Please enter employee number: ";

cin >> num;

cout << "Please enter employee hire date using the format \n";

cout << "2 digit month, 2 digit day, 4 digit year as one number: \n";

cout << "(Example August 12 1981 = 08121981)";

cin >> date;

cout << "Which shift does the employee work: \n";

cout << "Enter 1, 2, or 3";

cin >> shift;

cout << "Please enter the employee's rate of pay: ";

cin >> pay;

info.setemployeeName(name);

info.setemployeeNumber(num);

info.sethireDate(date);

info.setShift(shift);

info.sethourlyPay(pay);

cout << "The data you entered for this employee is as follows: \n";

cout << "Name: " << info.getemployeeName() << endl;

cout << "Number: " << info.getemployeeNumber() << endl;

cout << "Hire Date: " << info.gethireDate() << endl;

cout << "Shift: " << info.getShift() << endl;

cout << setprecision(2) << fixed;

cout << "Pay Rate: " << info.gethourlyPay() << endl;

system("pause");

return 0;

}

computer is an ............. machine because once a task is intitated computer proceeds on its own t ill its completion.​

Answers

Answer:

I think digital,versatile

computer is an electronic digital versatile machine because once a task is initiated computer proceeds on its own till its completation.

Which of the following CALL instructions writes the contents of EAX to standard output as a signed decimal integer?
a. call WriteInteger
b. call WriteDec
c. call WriteHex
d. call WriteInt

Answers

Answer:

d. call WriteInt

Explanation:

Required

Instruction to write to decimal integer

Of the 4 instructions, the call WriteInt instruction is used write to a decimal integer.

This is so, because the WriteInt instruction writes a signed decimal integer to standard output.

This implies that the output will have a sign (positive or negative) and the output will start from a digit other than 0 (i.e. no leading zero)

Other Questions
Ten examples of an interpreter which type of material is the best sound absorber?a. glassb. woodc. concreted. carpet Liz would like to study abroad for a year before graduating from college. She would like to live someplace that is close to her native country of Ireland in terms of development because she will need to use the Internet for many of her classes. She can choose from programs in three countries. What could she use to measure the economic performance of the three countries Does this word have a hard or soft consonant for a beginning letter?counthardsoft 12 Kendrick wants to build a slide for his son in the backyard. He buys aslide that is 8 feet long. The height of the stairs is 5 feet. Find thedistance from the bottom of the stairs to the base of the slide. can I please can some help on this question Unit 4 1. Which of the following actions would be considered substance abuse?A. using stimulants to study for school exams.B. taking an over-the-counter-drug without your doctor's prescription to treat a headache.C. getting a prescription from your doctor for an ear infection.D. All of these choices are correct.________________________2. Which of the following symptoms indicates a psychological dependency?A. developing an irregular heartbeat.B. relying upon marijuana to enjoy a movie.C. suffering from withdrawal headaches.D. None of the choices are correct.________________________3. The leading preventable cause of death in the United States is:A. tobacco useB. drunk drivingC. overdose of prescription drugs.D. illegal drug abuse.__________________________________________4. Snuff and chew are harmful because they:A. contain nicotine.B. increase problems with gum and tooth disease.C. significantly increase the risk of cancers of the mouth, lip, throat, and esophagus.D. All of these choices are correct.__________________________________________5. A person who has Emphysema feels:A. 7 relaxed.B. stimulatedC. suffocatedD. hyperactive__________________________________________6. Binge drinking is consuming:A. five or more drinks at a time for men.B. any form of hard alcohol.C. no more than three drinks per day for men.D. fewer than three drinks per week for women.__________________________________________7. Which of the following choices can speed up how fast alcohol leaves your body's system?A. a cold showerB. coffeeC. walking it offD. None of the choices are correct__________________________________________8. Cirrhosis is:A. an addiction to alcohol.B. cancer of the liver.C. inflammation of the liver.D. scarring of the liver__________________________________________9. At which of the following BAC levels can a person feel effects of the alcohol?A. 0.02B. 0.05C. 0.08D. 0.1__________________________________________10. Alcohol is classified as:A. a suppressant.B. an upper.C. a depressant.D. a stimulant. __________________________________________11. Drug abuse is:A. the consistent misuse of a drug or the use of a drug for something other than what it is intended.B. when a drug is taken by someone for whom it was not prescribed.C. when a drug is used as directed or prescribed for a specific illness or treatment.D. All of these choices are correct.__________________________________________12. Which of the following tips about prescription drugs is not good advice?A. Take medicine in the exact amount and on the same schedule prescribed by your doctor.B. Always tell your doctor about past problems you have had with drugs.C. Keep a daily record of all the drugs you take.D. Stop taking a prescription medicine if you feel better, even if there is left over medication.__________________________________________13. Drug tolerance is when:A. the body reacts negatively to a drug.B. a drug does not produce the same effects over a period of time.C. a person feels physical symptoms if they stop taking a drug.D. a person has a strong craving for a drug.__________________________________________14. Which of the following drugs would be considered a stimulant?A. ValiumB. heroinC. methamphetamineD. aspirin__________________________________________15. Heroin is one of the most addictive examples of:A. narcotics.B. hallucinogens.C. stimulants.D. prescription drugs.__________________________________________16. Which of the following infections causes small blisters on or around the genital area?A. pubic liceB. herpesC. gonorrheaD. chlamydia __________________________________________17. Which of the following forms of birth control on the market is the only one proven to reduce the transmission of HIV and other STDs?A. foamB. birth control pillC. IUDD. latex condoms__________________________________________18. Which of the following choices is a symptom of HIV?A. feverB. night sweatsC. fatigueD. All of these choices are correct.__________________________________________19. Which of the following statements about HIV is true?A. It attacks the body's immune system so that it cannot effectively fight off infections.B. It does not affect the person until it turns into AIDS.C. It causes cancer.D. None of these choices are correct. __________________________________________20. Follow-up tests are recommended for HIV blood tests that come back negative because the:A. tests are often wrong. B. technology is not very good.C. incubation period is unpredictable.D. All of these choices are correct. *PLEASE HELP ASAP I WILL MARK BRAINLIST*(Questions and Answers pictured) The weight Wkg of a metal bar varies jointly as it's length L and the square of it's diameter D mm. If W=140 when D =4 and L=54, find D interm of W and L C How can development resources be unled! Plain In your opinion, what can be done to develop Nepal? Make a list of suggestions How did migrant labour system affect the family lives in the community? How to organize an outdoor activity? *Check schedulesChoose appropriate venuesGet InsurancePhysical preparation Which part of the Thirteen Colonies is represented by Cluster B? Why is it important to vote? Give two (2) reasons. Two friends are working out together using weights:-James lifts 20kg weights up at a velocity of 1.9m/s-Kayla lifts 15kg weights up at a velocity of 2.6m/s0Which friend is creating more momentum? I want to climb the mountain closest to me, but Jim wants to climb the one farther away. Select the sentence that uses a demonstrative pronoun correctly. I want to climb that mountain, but Jim wants to climb the one farther away. I want to climb these mountain, but Jim wants to climb the one farther away. I want to climb this mountain, but Jim wants to climb the one farther away. I want to climb those mountain, but Jim wants to climb the one farther away. Discount Comics is running a special: 20 comics for $5.00. Seth purchases 30 comics for $7.50. What is the sale price per comic?$ per comic? I need help it is about physics Write an equation of the parabola that passes through the point (46, - 150) and has x-intercepts - 4 and 56 . Then find the average rate of change from x= -4 to x=6.An equation is y =The average rate of change is Compare the solubility of silver chloride in each of the following aqueous solutions: a. 0.10 M AgNO3 More soluble than in pure water. b. 0.10 M NaCI Similar solubility as in pure water c. 0.10 M KNO3 Less soluble than in pure water. d. 0.10 M NH4CH3COO