Computers and Technology

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 incrementsfor (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/5 // Draw top-right corner // Draw top-left corner}}}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 19:30, carcon2019
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
image
Computers and Technology, 23.06.2019 22:40, azariah7
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
image
Computers and Technology, 24.06.2019 00:20, danielmartinez024m
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
image
Computers and Technology, 24.06.2019 22:00, josephvcarter
Is the process of organizing data to reduce redundancy. a. normalization b. primary keying c. specifying relationships d. duplication
Answers: 1
Do you know the correct answer?
Write a program, which displays straight lines inside a rectangle from one side to a perpendicular s...

Questions in other subjects:

Konu
Physics, 28.11.2020 01:10
Konu
Mathematics, 28.11.2020 01:10