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 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}}}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Which number on the image above correctly indicates the name of a folder in this url? a.1b.2c.3d.4
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 07:50
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
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, 13.03.2021 07:40
question
Mathematics, 13.03.2021 07:40
question
Biology, 13.03.2021 07:40
question
Mathematics, 13.03.2021 07:40
question
Business, 13.03.2021 07:40
question
Mathematics, 13.03.2021 07:40
question
Biology, 13.03.2021 07:40
Questions on the website: 13722360