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.

Answers

Answer 1

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.


Related Questions

A town government is designing a new bus system and are deciding where to put the different bus stops. They want to pick the collection of locations that minimizes the distance anyone needs to walk in order to get to at least one bus stop. What term best defines the kind of problem?

An optimization problem

An undecidable problem

An efficiency problem

A decision problem

Answers

Answer:

Optimisation Problem

Explanation:

Optimisation Problem is a mathematical economics, computer science problem - which finds the best solution from all feasible solutions (based on constraints & other aspects).

The problem might be in form of maximisation or minimisation. The bus system designing is based on minimizing walking distance. Thus is an optimisation problem.

The term which best defines this kind of problem is: A. An optimization problem.

A problem can be defined as an issue or challenge encountered by an individual, which typically requires a solution.

Basically, a problem is considered to either be simple or complex, depending on the individual, parameters, and factors that are involved.

Generally, there are four (4) main kinds of problem and these include:

An undecidable problem.A decision problem.An efficiency problem.An optimization problem.

An optimization problem determines the best solution to a problem, from a list of feasible solutions.

Hence, an optimization problem can be used to pick a collection of locations that are likely to minimize the distance anyone needs to walk, so as to get to at least one bus stop.

Read more: https://brainly.com/question/22828534

Evidence that a source is authoritative includes a. An email address to ask further questions about information in the source c. No verbiage used which could identify bias about the information provided b. A date regarding when the source was written d. Logical structure of the information provided so that it is easily read and understood Please select the best answer from the choices provided A B C D

Answers

Answer:

i belive   it iz      C

Explanation:

o

Answer:

The correct answer is A

Explanation:

Will give BRAINEST if it's a very good answer
I keep asking for a phone and making reasons why i should have a phone, but if there's an emergency like kidnapping ima need to have a phone. but my parents say the first thing the'll do is take it away from you. What do i say to that response bc i rlly want a phone

Answers

Answer:

you have to try making them understand how important is your phone

A secure website has https instead of http in web address true or false

Answers

Answer:

True

Explanation:

Beacuse security is s

The answer to the question is true

Fill in the blank
A file can be saved with a different file name than it currently has by clicking on Save____ in the File tab.

Answers

Explanation:

save as because if u want to save the bame of it press save as to save it as what u want

Answer:

save as

Explanation:

if you're gonna save it over writing a different one save as is the answer

what are output devices ?
name them​

Answers

Answer:

Monitor.

Printer.

Headphones.

Computer Speakers.

Projector.

GPS.

Sound Card.

Video Card.

Explanation:

explain what led to the invention of lasers

Answers

Answer:

The laser is an outgrowth of a suggestion made by Albert Einstein in 1916 that under the proper circumstances atoms could release excess energy as light—either spontaneously or when stimulated by light.

Explanation:

The laser is an outgrowth of a suggestion made by Albert Einstein in 1916 that under the proper circumstances atoms could release excess energy as light—either spontaneously or when stimulated by light. German physicist Rudolf Walther Ladenburg first observed stimulated emission in 1928, although at the time it seemed to have no practical use.

In 1951 Charles H. Townes, then at Columbia University in New York City, thought of a way to generate stimulated emission at microwave frequencies. At the end of 1953, he demonstrated a working device that focused “excited” (see below Energy levels and stimulated emissions) ammonia molecules in a resonant microwave cavity, where they emitted a pure microwave frequency. Townes named the device a maser, for “microwave amplification by the stimulated emission of radiation.” Aleksandr Mikhaylovich Prokhorov and Nikolay Gennadiyevich Basov of the P.N. Lebedev Physical Institute in Moscow independently described the theory of maser operation. For their work all three shared the 1964 Nobel Prize for Physics.

An intense burst of maser research followed in the mid-1950s, but masers found only a limited range of applications as low-noise microwave amplifiers and atomic clocks. In 1957 Townes proposed to his brother-in-law and former postdoctoral student at Columbia University, Arthur L. Schawlow (then at Bell Laboratories), that they try to extend maser action to the much shorter wavelengths of infrared or visible light. Townes also had discussions with a graduate student at Columbia University, Gordon Gould, who quickly developed his own laser ideas. Townes and Schawlow published their ideas for an “optical maser” in a seminal paper in the December 15, 1958, issue of Physical Review. Meanwhile, Gould coined the word laser and wrote a patent application. Whether Townes or Gould should be credited as the “inventor” of the laser thus became a matter of intense debate and led to years of litigation. Eventually, Gould received a series of four patents starting in 1977 that earned him millions of dollars in royalties.

The Townes-Schawlow proposal led several groups to try building a laser. The Gould proposal became the basis of a classified military contract. Success came first to Theodore H. Maiman, who took a different approach at Hughes Research Laboratories in Malibu, California. He fired bright pulses from a photographer’s flash lamp to excite chromium atoms in a crystal of synthetic ruby, a material he chose because he had studied carefully how it absorbed and emitted light and calculated that it should work as a laser. On May 16, 1960, he produced red pulses from a ruby rod about the size of a fingertip. In December 1960 Ali Javan, William Bennett, Jr., and Donald Herriott at Bell Labs built the first gas laser, which generated a continuous infrared beam from a mixture of helium and neon. In 1962 Robert N. Hall and coworkers at the General Electric Research and Development Center in Schenectady, New York, made the first semiconductor laser.

While lasers quickly caught the public imagination, perhaps for their similarity to the “heat rays” of science fiction, practical applications took years to develop. A young physicist named Irnee D’Haenens, while working with Maiman on the ruby laser, joked that the device was “a solution looking for a problem,” and the line lingered in the laser community for many years. Townes and Schawlow had expected laser beams to be used in basic research and to send signals through air or space. Gould envisioned more powerful beams capable of cutting and drilling many materials. A key early success came in late 1963 when two researchers at the University of Michigan, Emmett Leith and Juris Upatnieks, used lasers to make the first three-dimensional holograms (see holography).

Helium-neon lasers were the first lasers with broad commercial applications. Because they could be adjusted to generate a visible red beam instead of an infrared beam, they found immediate use projecting straight lines for alignment, surveying, construction, and irrigation. Soon eye surgeons were using pulses from ruby lasers to weld detached retinas back in place without cutting into the eye. The first large-scale application for lasers was the laser scanner for automated checkout in supermarkets, which was developed in the mid-1970s and became common a few years later. Compact disc audio players and laser printers for personal computers soon followed.

How do use a search engine?

Answers

Answer:

You choose your search engine then you click the search bar and type what you want to know enter it and then click a website to visit

Explanation:

Choose the correct term to complete the sentence.

______play(s) an essential role in calculating, gathering, and storing information in
the workplace

1.) breaches
2.) technology
3.) training

Answers

Answer:

3.) Technology

Explanation:

Technology is pretty epic, my dude.

Which team member on a project typically has a skill for creating visual interest?

Designer
Engineer
Programmer
Writer

Answers

Answer:

designer

Explanation:i took it and got it right

3. When a small business buys office supplies online, it is an example of business-to- business e-commerce.
a. True
b. False​

Answers

Answer:

TRUE

Explanation:

Answer:

TRUE i think

Explanation: For example, an automobile manufacturer makes several B2B transactions such as buying tires, glass for windscreens, and rubber hoses for its vehicles. The final transaction, a finished vehicle sold to the consumer, is a single B2C transaction.

2. Identify two real-world examples of problems whose solutions do not scale well.

Answers

Answer:

The specification is defined downwards according to the conclusions reached.

Explanation:

Real-world instances or examples of issues that do not scale well are listed following table:

For different uses, such as solving the equation, respectively., multiplication matrices. It still does not scales or works well to organize a wide sequence of names or numbers as the requisite measures raise as squares by around the enlargement or increment.

If you have different movie or audio file types saved to your computer and your computer can only play the OGG format instead of the MP4 video format, what should you do?

Answers

Answer:

convert the MP4 format file to the OGG format file                  

Explanation:        

An OGG file is a compressed audio file of Ogg Vorbis that is used for holding audio data. It is a free and an open container file format which is maintained by Xiph.Org Foundation. OGG format file can multiplex independent streams of video, text, audio and meta data.

The OGG file has better sound quality and characteristics than a MP3 or MP4 files. The MP4 file format can be converted into OGG format file if the files are saved in different formats in the computer which can play only OGG format.

the full forms
MU
memory unit
CU
control unit​

Answers

Answer:

u asking or saying ? ?????

ASAP in the middle of this quiz Which of the following arguments might convince a local school board of the need to train upper elementary school students in IT practices?


A As technology continues to advance rapidly, the need for IT professionals grows, providing more opportunities for employment of individuals skilled and experienced in the field of IT.

B Brain research shows that elementary students are better able to understand complex procedures; therefore, upper elementary students are more likely to understand the principles of IT than high school or college students.

C School computers break down often because of student use; therefore, the students should be responsible for fixing them.

D Computers are the wave of the future; therefore, elementary students should have a complete understanding of how they function.

Answers

Answer:

A.

Explanation:

Answer D seems too simplistic, and the question specifically mentions IT practices.

Question B doesn't seem right - college and high school students would likely be able to understand the principles as much.

Question C wouldn't be a good argument for a school board, and there's not a lot of evidence that backs it up.

Therefore, A seems to be the best choice here.

Hope this helps!

Kyle returns to work the next day and he would like to continue working on the document from yesterday. What should Kyle do?


Double-click on the Start menu.

Look for his open document in the system tray.

Locate his file and click twice on it.

Locate his file, right click, and select Print.

Answers

Answer:

Locate his file and click twice on it.

Edhesive 3.5 code practice quetion one

Answers

Answer:

x = int(input("What grade are you in? "))

if (x == 9):

   print("Freshman")

elif (x == 10):

   print("Sophomore")

elif (x == 11):

   print("Junior")

elif (x == 12):

   print("Senior")

else:

   print("Not in High School")

Explanation:

Hope this helps lovely :)

WILL GIVE BRAINLIEST!!!!!
This law of Sir Isaac Newton is what allows the spacecraft to lift off.

First Law

Second Law

Third Law

Answers

Third law :) Hope this helped you

Answer:

Third law

Explanation:

Third law allows the spacecraft to lift off.

Joseph is a digital media developer and has years of work experience. He now wants to improve his management skills. What can he do to develop and sharpen his managerial skills? To improve his managerial skills, Joseph can enroll in a degree program.

Answers

Answer:

Following are the solution to this question:

Explanation:

Soft skills are best developed for irrespective of the occupation technical skills is a common skill, which everyone requires to master to work together and carry mostly on work successfully. A technically gifted individual needs soft skills to work with each other to the concept of work, to resolve issues, etc. The different soft training programs for different roles and decades of expertise are offered. therefore Professors propose learning in soft skills as well as an MBA degree.

Write a function called min that returns the minimum of the two numbers passed in as parameters.

Note: Be sure to include comments for all functions that you use or create.

For example, if you made a call like

x = min(10, 14)
x should have the value 10.

For your program, you need to define the function and call it and print out the result like this:

x = min(10, 14)
print("The min is " + str(x))

min(1,2);
min(9000,9001);

it is in python

Answers

def min(x,y):

   smallest = x

   if y < smallest:

       smallest = y

   return smallest

x = min(2,1)

print("The min is "+str(x))

Although I wouldn't recommend using the name min for a function because min is the name of an existing function. Best of luck.

The function is an illustration of conditional statements.

Conditional statements are statements whose execution depends on their truth values.

The function in Python, where comments are used to explain each line is as follows:

#This defines the function

def min(num1,num2):

#This initializes minVal

  minVal = num2

#If num1 is less than num2, then

  if num1 < num2:

#minVal equals num1

      minVal = num1

#This returns the smaller value

  return minVal

At the end of the program, the smaller value is returned to the main

Read more about similar programs at:

https://brainly.com/question/6973180

What connections do you see between variables and what you learned about the Input-Output-Store-Process model of a computer?

Answers

Answer:

h

Explanation:

The image shows a sample group contract.

This group contract is important because it:

A) holds everyone accountable for their part in the project

B) summarizes expectations for the conduct of the group

C) discusses how adjustments to the schedule can be
made

D) assigns a time frame for each step to be completed

Answers

Answer: c

Explanation:I done this before;DDD

Answer:

Its A

Explanation:

Sorry the other guy is wrong

The binary number represented by the voltage graph below is

Answers

Answer:

4

Explanation:

Answer: 11010100

here ya go :)

Which are characteristics of interpreters? Select
all that apply.
translate high-level programming language
into binary computer machine language
offer a program run-time that is faster than
when a compiler is used for the translation
make it possible to change the source
program while the program is running
offer a program run-time that is slower than
when a compiler is used for the translation

Answers

Answer:

translation is used for interpretation

Write a program to find the product of 3 numbers

Answers

Answer:

#include<iostream>

using namespace std;

int main()

{

   int a,b,c;

   cout<<"enter the value of a:";

   cin>>a;

   cout<<"enter the value of b:";

   cin>>b;

   cout<<"enter the value of c:";

   cin>>c;

   cout<<"product is:"<<(a*b*c);

   return 0;

}

Explanation:

The following codes have been written using Python.

x = int(input("Enter a number: "))

y = int(input("Enter a number: "))

z = int(input("Enter a number: "))

p = x*y*z

print(p, "is the product of", x, y, "and", str(z)+ ".")

Hope it helps. :)

2. List at least three signal words the professor uses in the video. How did he use the signal

words?

Answers

Answer:

cherry

van

red

George

gold

Question # 6
Multiple Choice
The of a variable is determined by which parts of a program can view and change its value.
O influence
O magnitude
O scope
Orange

Answers

Answer:

Scope.

Explanation:

In programming, the scope could be static, private or public and in those, defines the scope of a specific variable.

Ex.

public int x = 0; // Can be seen when called within a whole class and outside of a class/ function.

private int y = 0; // Can be seen only within the class its defined in.

static pub/priv int z = 0; // Uncangeable variable that can be defined in both class and external class, depending on the two prior scopes defined after.

int aa = 0; // Defaults to private.

Answer:

the answer is scope, for me it's D but they tend to change.

Explanation:

Daniel is writing about emergency steps to take if a fire breaks out in school. Which organizational aid would be
most useful?
O a sequence chart
O a timeline
a Venn diagram
O a web diagram

Answers

Answer:

sequence chart

Explanation:

Answer:

a sequence chart

Explanation:

i took the test

List 5 applications for working with text

Answers

Answer:

TTSReader, Go2PDF, Free File Merge, Batch Text File Editor

Explanation:

30 points! Help me out, please! I need help with this!

Answers

Answer:

Both are touchscreen.

Tablets are seen more as an entertainment device (tv, games, etc.).

Phones are smaller, and used more for everything; you can take phones anywhere you go, whereas tablets are more difficult to transport.

Other Questions
Write an equation of the line parallel to given that contains C(6,-2);=-3/2x+6Please answer this asap please solve this0.62.4= Which is the correct way to write "the square root of 16?" A) 163 B) 162 C) 32 D) 16 could someone help me please!! Susan is going to a Columbia Fireflies game. Each ticket (t) costs $14. She also had to pay $8 for parking. If she can spend $50 or less total, how many tickets can she buy? Solving Real World Linear Inequality Applications a _____follows a sequential order, as the events are told in the order they occur.A. subplot B. linear plotC. flashback D. foreshadowing E. parallel plot Which statements are true about both Japan and China?Check all that apply.A. Japan had significant growth that began after World War II andkept going until a recession hit in the 1990s.B. China still places strong restrictions on its people.C. Much of the construction in Tokyo was driven by their hugeeconomic growth after World War II.D. China and Japan have the same forms of government. What are the factors of the trinomial? Select two options.x 14x + 7x 7x 2x + 2 30 points , please help just pick the right one. If you troll Im reporting your answer :) What safety factors should astronauts be aware of when collecting rock samples on the Moon? URGENT: (Ill give first person brainlyist) What type of elements typically become positively charged ions? what's the equivalent expression of 2(4x+1) Watch the video about Faith Ringgold. What are your thoughts on the subject she choose to create work about? There are 28 Year 8 students going on the ski trip, out of the 45 students going. Write this proportion as a percentage. Give your answer correct to 1 decimal place. critically evaluate the role of human beings in perpetuating climate change 3x+2y=0 x-5y=17solve in a Solving Systems by Elimination Choose the sentences below that provide evidence of each author's point of view. Please help me..1. Violence in Hollywood movies has become excessive and is putting our youth and our entire society at risk for violent behaviors.2. Hollywood filmmakers include violence in movies as part of the craft of storytelling, to create an enjoyable movie-going experience for the audience.3. In the golden age of Hollywood, filmmakers relied on solid storytelling techniques to entertain audiences.4. It is not right to restrict their abilities to tell stories through film, nor is it right to limit entertainment options for people who enjoy watching action and horror movies and have no tendency toward violence.5. Unfortunately, today's film industry often draws audiences to movie theaters with promotional promises of action-packed violence, brutal murders, and mass destruction. A. Sentences 1, 3, and 4 B. Sentences 2 and 3 C. Sentences 1, 4, and 5 D. None of the sentences provide evidence Pls help me hurry pls Describe the shape of the distribution A track star runs 100 meters in 10 seconds. What is the star's average speed? The lines shown below are parallel. If the green line has a slope of -3/7, what isthe slope of the red line?