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, 23.06.2019 00:30
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
question
Computers and Technology, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesn’t exist arrowright reset next
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
Chemistry, 02.11.2020 21:50
question
Spanish, 02.11.2020 21:50
question
Mathematics, 02.11.2020 21:50
question
Mathematics, 02.11.2020 21:50
Questions on the website: 13722367