1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
labwork [276]
3 years ago
7

. Complete the code, drawing a line between points (100, 200) and (34, 67)

Computers and Technology
1 answer:
Galina-37 [17]3 years ago
8 0

Answer:

The answer for the given question is given below:

public void paint( Graphics g )

{

g.drawLine(100, 200 ,34, 67);

}

Explanation:

In this code we are using “drawLine” method to draw the line between the points

The graphics object “g” is to call the drawLine method .

The syntax of drawline method is given below

drawLine(int X1, int Y1, int X2, int Y2)

Where  X1,  Y1,  X2,  Y2 are the points in the x and y coordinate

Following are the full code of that program  

import java.applet.Applet; // package of applet

import java.awt.Graphics; // package of awt  

public class line1 extends Applet  //inherit applet class

{

public void paint( Graphics g ) // paint method

{

g.drawLine(100, 200 ,34, 67); // drawline

}

}

It draw the corresponding line between the coordinate

You might be interested in
Is a protocol that allows users to log on to and access a remote computer?
kompoz [17]
The answer is yes I hope this help ya out

6 0
3 years ago
What is the meaning of DHCP
Leni [432]

Answer:

A Dynamic Host Configuration Protocol

Explanation:

5 0
3 years ago
The function below takes two arguments, a dictionary called dog_dictionary and a list of dog names (strings) adopted_dog_names.
laiz [17]

Answer:

The solution code is written in Python.

  1. def removeAdoptedDog(dog_dictionary, adopted_dog_names):
  2.    for x in adopted_dog_names:
  3.        del dog_dictionary[x]
  4.    
  5.    return dog_dictionary  
  6. dog_dictionary = {
  7.    "Charlie": "Male",
  8.    "Max" : "Male",
  9.    "Bella" : "Female",
  10.    "Ruby": "Female",
  11.    "Toby": "Male",
  12.    "Coco": "Female",
  13.    "Teddy": "Male"
  14. }
  15. print(dog_dictionary)
  16. adopted_dog_names = {"Ruby", "Teddy"}
  17. print(removeAdoptedDog(dog_dictionary, adopted_dog_names))

Explanation:

Firstly, let's create a function <em>removeAdoptedDog() </em>takes two arguments, <em>dog_dictionary </em>& <em>adopted_dog_names</em> (Line 1)

Within the function, we can use a for-loop to traverse through the <em>adopted_dog_names</em> list and use the individual dog name as the key to remove the adopted dog from <em>dog_dictionary </em>(Line 3). To remove a key from a dictionary, we can use the keyword del.

Next return the updated dog_dictionary (Line 5).

Let's test our function by simply putting some sample records on the <em>dog_dictionary</em> (Line 7 -15)  and two dog names to the <em>adopted_dog_names list</em> (Line 19).

Call the function <em>removeAdoptedDog() </em>by<em> </em>passing the <em>dog_dictionary and adopted_dog_names </em>as arguments. The display result will show the key represented by the<em> adopted_dog_names</em> have been removed from the <em>dog_dictionary </em>(Line 21).

4 0
4 years ago
While loop for python<br> Plz help!!!! It’s due today
DIA [1.3K]

Loop for python and Java developer ghjfgj

6 0
3 years ago
To give boarder to cell select ___ tab from the format cell window
Anettt [7]

Answer:

TO GIVE BOARDER TO CELL SELECT CHART ELEMENTS TAB FROM THE FORMAT CELL WINDOW.

brainlist plz

3 0
3 years ago
Other questions:
  • Clicking a _____ name opens a drop-down list of commands and options.
    6·1 answer
  • The network services and facilities that users interact with are provided by
    11·1 answer
  • By default, the windows password policy requires a minimum password of what length?​ select one:
    7·1 answer
  • In a bubble sort, you use a(n) ____ loop to make pair comparisons.
    5·1 answer
  • Types of relationships include aggregation, composition, link, generalization, and specialization 9. TRUE FALSE
    9·1 answer
  • Given the class definition: class CreateDestroy { public: CreateDestroy() { cout &lt;&lt; "constructor called, "; } ~CreateDestr
    6·1 answer
  • The steps.txt file contains the number of steps a person has taken each day for a year. There are 365 lines in the file, and eac
    12·1 answer
  • What structure is a candle​
    13·1 answer
  • Rafter type and Truss type?
    5·1 answer
  • The scope of a temporary table is limited to what?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!