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, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
3. what do the terms multipotentialite, polymath, or scanner mean?
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
7.23 main lab 7 - online shopping cart background this main lab extends the earlier prep lab "online shopping cart part 1". (you should save this as a separate project from the earlier prep lab). you will create an on-line shopping cart like you might use for your on-line purchases. the goal is to become comfortable with setting up classes and using objects. requirements this lab can be done individually or as pair programming. expanded itemtopurchase class (15 points) extend the itemtopurchase class as follows. we will not do unit testing in this lab so we will not be giving you the names of the member functions. create good ones on your own. create a parameterized constructor to assign item name, item description, item price, and item quantity (default values of "none" for name and description, and 0 for price and quantity). additional public member functions set an item description get an item description print the cost of an item - outputs the item name followed by the quantity, price, and subtotal (see example) print the description of an item - outputs the item name and description (see example) additional private data members a string for the description of the item. example output of the function which prints the cost of an item: bottled water 10 @ $1.50 = $15.00 example output of the function which prints the item description:
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Is the process of organizing data to reduce redundancy. a. normalization b. primary keying c. specifying relationships d. duplication
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
History, 06.11.2019 23:31
question
History, 06.11.2019 23:31
Questions on the website: 13722367