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
Paladinen [302]
3 years ago
6

Create a program that draws a rectangle whenever you click the mouse. The rectangle should have a width of 30 and a height of 50

and be centered at the place where the user clicks. Remember, the position of a rectangle is the top left corner. To place the rectangle at the center of the click, you will need to adjust the position.
Computers and Technology
1 answer:
Alinara [238K]3 years ago
6 0

Answer:

RECT_HEIGHT = 50

RECT_WIDTH = 30

rect = Rectangle(50,30)

       

# random.choice returns a random value from the COLORS

# function will draw a rectangle at x, y

def draw_rect(x, y):

   rectangle = Rect(50, 30)

   rect.set_position(x, y)

   rect.set_color(Color.green)

   add(rect)

# Link to the mouse click event

   add_mouse_click_handler(draw_rect)

Explanation: Hope this works for you.

You might be interested in
Which statement describes a printer driver? a) It is the configuration code that is sent to a printer to identify the operating
White raven [17]

Answer:

Option (b) is the correct and suitable answer for the above question.

Explanation:

The printer is a hardware which is used to convert the soft copy of an information to a printed copy (Hard copy) of information.

To use printer hardware a computer system needs a printer driver which is used to do the conversion from soft copy to a hard copy. Hardware printer uses only for the purpose to print the copy.

The option b says that the printer driver is used to convert the document into the form of that document which the printer can understand easily. It means conversion from soft copy to hard copy. Hence it is the right option.

The reason behind the other option which is not valid because--

Option a says that the printer driver is a code but it is a software.

Option c says that the printer driver is an interface but it is a software.

Option d says that the printer driver is a cache but it is a software.

4 0
3 years ago
You decide to buy some stocks for a certain price and then sell them at anotherprice. Write a program that determines whether or
Otrada [13]

Answer:

no_of_shares = int(input("Enter the number of shares: "))

purchase_price = float(input("Enter the purchase price of the stock: "))

sale_price = float(input("Enter the sale price of the stock: "))

total_stock_price = purchase_price*no_of_shares

total_spend_on_buying = total_stock_price + (0.03*total_stock_price)

total_sale_price = sale_price*no_of_shares

commission_while_selling = total_sale_price*0.03

net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)

if(net_gain_or_loss<0):

print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))

else:

print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))

7 0
3 years ago
Which recorder is least recommended in automation anywhere?
raketka [301]
<h2>Answer:</h2>

<u>Screen recorder</u><u> is the least recommended one</u>

<h2>Explanation:</h2>

There are three types of recorders. They are Smart Recorder, Web Recorder and Screen or sometimes called Standard Recorder. Smart Recorder is used for desktop applications while Web recorder is used for Web-based applications. The least recommended one is Screen Recorder which is used for building simple tasks that involves few mouse clicks and keystrokes. It works by capturing screen co-ordinates and therefore, no calibration is taken into account. It is generally used when you plan to run the task on the same machine on which, it was recorded.

4 0
3 years ago
Read 2 more answers
ENG103 DISCUSSION BOARD 6
amm1812
The proper citation for your course of study -computer related- is APA (American Psychological Association)  format. This citation format allows us to state the publication date, title , and authors in an organized and short fashion. All scholarly reports that are technology or psychology based, should be cited in APA format. 

<span>I know this because it is the format I use for all of my college courses which are all Computer/Technology related. </span>
3 0
3 years ago
GNU is the name of the organization that created GIMP.
aalyn [17]
September 1983 hope this helps u good luck
4 0
3 years ago
Other questions:
  • In your opinion, is it more beneficial to have many folders or is it better to “nest” subfolders? Explain your response.
    10·2 answers
  • It can be useful to have a mentor because they will help you
    7·2 answers
  • What port number is the web server listening on for the web request?
    9·1 answer
  • WHERE WAS THE CHEESEBURGER INVENTED?
    9·1 answer
  • Can you list the answers in order
    12·1 answer
  • Int a=10 int b=20<br> A=b<br> The new values for a and b are
    11·2 answers
  • What kind of software consists of programs designed to make users more productive and/or assist them with personal tasks?
    10·1 answer
  • In which generation of computers are we in?​
    9·1 answer
  • Ajdbksjdnksnsd helppp​
    11·1 answer
  • Ryan would like to copy a list of contacts from a colleague into his personal address book. The list of contacts is contained in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!