hey guys i have another question im stumped on here it is
You are given one rectangle, called box1.
Make a second rectangle, called box2, so that
the top left corner of box2 is in the center of box1,
and the width of box2 is half the width of box1.
and the height of box2 is half the height of box1.
public class IntersectionPrinter
{
public static void main(String[] args)
{
Random random = new Random() ;
Rectangle box1 = new Rectangle(100, 200, 300, 400) ;
//----------------------Start here. Do not remove this comment.
// todo
// approximate lines of code required: 1
//----------------------End here. Do not remove this comment.
Rectangle box3 = box1.intersection(box2) ;
System.out.println(box2.equals(box3)) ;
my prof already made the program i just have to edit it. although im not sure how to come with line of code required if anyone can help me it will be much appreciated!
You are given one rectangle, called box1.
Make a second rectangle, called box2, so that
the top left corner of box2 is in the center of box1,
and the width of box2 is half the width of box1.
and the height of box2 is half the height of box1.
public class IntersectionPrinter
{
public static void main(String[] args)
{
Random random = new Random() ;
Rectangle box1 = new Rectangle(100, 200, 300, 400) ;
//----------------------Start here. Do not remove this comment.
// todo
// approximate lines of code required: 1
//----------------------End here. Do not remove this comment.
Rectangle box3 = box1.intersection(box2) ;
System.out.println(box2.equals(box3)) ;
my prof already made the program i just have to edit it. although im not sure how to come with line of code required if anyone can help me it will be much appreciated!