[SOLVED] SOLVED: Lab 3 - Decisions - CircleOverlap

25.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

Lab 3 – Decisions

Complete the following code to test whether two circles, each having a user-defined radius and a fixed center point lying along the same horizontal line, are disjoint, overlapping, or mutually contained. Consider how you would do it manually first.

“`java
import java.util.Scanner;

public class CircleOverlap
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print(“Input the radius of the first circle: “);
double radius1 = in.nextDouble();
double xcenter1 = 0;
double ycenter1 = 0;
System.out.print(“Input the radius of the second circle: “);
double radius2 = in.nextDouble();
double xcenter2 = 40;
double ycenter2 = 0;
// Your work goes here
}
}
“`

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.