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
Marina CMI [18]
3 years ago
12

Write a program that will draw a red circle on top of a blue square in the center of the canvas. The blue square should have sid

es of 100 pixels each and the red circle should have a diameter of 100 pixels
it's thru codehs and it's due tomorrow so
Computers and Technology
1 answer:
MakcuM [25]3 years ago
3 0

Answer:

Explanation:

The following code is written in Python. It uses the imports the turtle class in order to be able to draw a blue square with 100pixels per side and then a red circle with a diameter of 100 pixels that fits perfectly inside the square.

import turtle

t = turtle.Turtle()

#Make Square

t.fillcolor('blue')

t.begin_fill()

t.back(50)

for i in range(4):

 t.forward(100)

 t.left(90)

t.end_fill()

#Make Circle

t.forward(50)

t.fillcolor('red')

t.begin_fill()

t.circle(50)

t.end_fill()

You might be interested in
Add a throw statement to the processNumbers function that throws the message "All elements in the list should be numbers." if on
Tju [1.3M]

Answer:

  1. function processNumbers(numList){
  2.    try{    
  3.        for(let i=0; i < numList.length; i++){
  4.            if(isNaN(numList[i])){
  5.                throw "All elements in the list should be numbers.";
  6.            }
  7.            
  8.        }
  9.    }
  10.    catch(err){
  11.        console.log(err);
  12.    }
  13. }
  14. let myList = [4, 6, 1, "abc", 9];
  15. processNumbers(myList);

Explanation:

The solution code is written in JavaScript as the isNaN() is an in-built function in JavaScript.

Firstly, create a function processNumbers that takes one input number list, numList (Line 1).

To handle the possible Not a Number (NaN) error, create a try and catch block. In the try block, create a for-loop to traverse through the numList array and use isNaN function to check if the current value is a number (Line 3 - 4). If it is not a number, isNaN will return true and the program will run the throw statement (Line 5). The throw message will be passed to the catch block and display it on console (Line 10 - 12).

We can test the function by using the sample list (Line 15 - 16) and we shall see the thrown error message is displayed.  

5 0
3 years ago
The purpose of the ________ element is to describe the contents of a table.
Korolek [52]
<caption> element.

It is used to add a caption to a HTML table. With CSS, it may be positioned right at the bottom of the table but in HTML, it must appear as the 1st descendant of a parent <table>. Note that you can specify only one caption in a single table.






4 0
3 years ago
From the philosophical standpoint, especially in the discussion of moral philosophy or ethics, why do we consider “murder” or “k
wlad13 [49]

Explanation:

Morality is a set of values ​​and habits that a society acquires over time and can be categorized as good and bad values, right and wrong, justice and crime. Ethics is defined as the study of morals, the practical application of moral behaviors defined by society.

Therefore, the concept of "murder" or "killing" is seen as an immoral act by the vast majority of society around the world, strengthened by the set of moral conduct common to all human beings, which are the Articles on the Universal Declaration of Human Rights. Human Rights, which is an official document of the UN, which contains several universair and analytical rules on the rights of every individual, such as the right to life, security, freedom, etc.

7 0
3 years ago
When installing a network cable with multiple strands, a network technician pulled the cable past a sharp edge and exposes the c
MariettaO [177]

Answer:

A short

Explanation:

A short in electrical terms is an abbreviation for a short circuit. This generally means that there is an unintended connection between two points allowing current to flow where it should not. In your particular case, it means that a cable is damaged and that two or more of the conductors are connected together causing the cable to fail.

8 0
4 years ago
Which access database object asks a question about the data stored in a database and displays specific fields and records that a
elena-14-01-66 [18.8K]
The Query object is used to asks a question about the data stored in a database and displays the specific fields and records that answer the question.

In code form, the select command is used for queries. 
6 0
3 years ago
Other questions:
  • Five indicators of computer illiteracy​
    13·1 answer
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·1 answer
  • 8.8 Lab: Swapping variables Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the
    15·1 answer
  • A STUDENT can take many COURSES and a COURSE can have more than one STUDENT enrolled in the course. In this case, both the "stud
    5·1 answer
  • Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns
    14·1 answer
  • The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an eleme
    9·1 answer
  • Why do you think it is necessary to set the sequence in which the system initializes video cards so that the primary display is
    15·1 answer
  • Write a java program to input the corresponding data to print the result of the following expression
    9·1 answer
  • In order to send a photo in a text message from your cell phone to your cousin's cell phone who lives in New Zealand, is it nece
    8·1 answer
  • Cú pháp câu lệnh xóa thủ tục
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!