subject

Write a program, which displays straight lines inside a rectangle from one side to a perpendicular side. The lines must be drawn in such a way that both the starting points of the lines on one side and the ending points on the other side are equidistant along the sides. The size of the rectangle is 980 pixels width by 630 pixels height.

For full points: repeat the entire process by drawing a small copy of the border inside the blank space of the design.

Code I have so far:

import java. awt.*;
import java. applet.*;
public class graphics extends Applet
{
public void paint(Graphics g)
{
int width = 980;
int height = 630;
//int x1 = 10;
//int y1 = 640;
//int x2 = 990;
//int y2 = 640;

int x1 = 990;
int y1 = 10;
int x2 = 490;
int y2 = 640;
g. drawRect(10,10,width, height);

// the x1, x2, y1,y2 coordinates
// add a for loop that increments
for (int i = 0 ; i < height; i++)
{
g. drawLine(x1,y1,x2,y2);
x1 += width/ 50;
y2 -= height/ 50;

// Draw bottom-right corner
//loop will run 51 times
//x increment or decrement by some number/50
//y increment or decrement by some number/50

// Draw bottom-left corner
//loop will run 51 times
//x increment or decrement by some number/50
//y increment or decrement by some number/50

// Draw top-right corner

// Draw top-left corner
}
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
Jenny wants to look at row 345 and compare it to row 17. what can she do if she wanted to easily adjust to see both at once?
Answers: 3
question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 22.06.2019 12:30
What characteristic of long period comets suggest they come directly from the oort cloud?
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
You know the right answer?
Write a program, which displays straight lines inside a rectangle from one side to a perpendicular s...
Questions
question
Mathematics, 19.11.2020 07:20
question
Mathematics, 19.11.2020 07:20
question
History, 19.11.2020 07:30
question
Mathematics, 19.11.2020 07:30
question
SAT, 19.11.2020 07:30
question
English, 19.11.2020 07:30
question
Mathematics, 19.11.2020 07:30
Questions on the website: 13722361