Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose: Practice updating variables and working with the string data type Degree of Difficulty: Easy For this question, you will write a simple labelling program

Purpose: Practice updating variables and working with the string data type Degree of Difficulty: Easy

For this question, you will write a simple labelling program that allows the user to place a single text label anywhere on the canvas.

Your program should behave as follows: When the program starts: Display a blank, black canvas. Initialize the current location of the text label to be somewhere in the middle of the screen (although the user wont be able to see the label, as there is no text yet).

When the user presses a key: Add anything that the user types to the label being displayed). When the user clicks the mouse: Remove all text from the current label; set the label coordinates to be equal to the coordinates of the mouse.

You will need to use variables in this program to keep track of the position of the label, as well as the text of the label itself.

this is programming and language is python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Summarise the scope of HRM and the key HRM functions

Answered: 1 week ago