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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:30, bankzdown
The method of presentation refers to the planning process for the presentation. the information chosen for the presentation. how the presentation topic will be introduced. how the presentation will be delivered.
Answers: 1
image
Computers and Technology, 22.06.2019 11:20, destinyleisantos
The kurt vonnegut commencement speech, the neiman-marcus chocolate chip cookie recipe, and the get-well emails to the dying boy are examples of select one: a. social engineering b. hoax emails c. email viruses d. worms
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, hannahrasco4051
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
image
Computers and Technology, 23.06.2019 02:30, woodpeckerdeejpe8wvh
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
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 in other subjects:

Konu
Mathematics, 24.02.2021 21:10
Konu
Mathematics, 24.02.2021 21:10