Answer:
Explanation:
function draw()
{
var ctx = document.getElementById("myCanvas").getContext("2d");
var counter = 0;
for (var i=0;i<6;i++)
{
for (var j=0;j<6;j++)
{
//Start from white and goes to black
ctx.fillStyle = "rgb(" + Math.floor(255-42.5*i) + "," + Math.floor(255-42.5*i) +
"," + Math.floor(255-42.5*j) + ")";
ctx.beginPath();
if (i === counter && j === counter)
{
//creates the circles
ctx.arc(25+j*50,30+i*50,20,0,Math.PI*2,true);
ctx.fill();
//creates a border around the circles so white one will be vissible
ctx.stroke();
}
}
counter++;
}
}
draw();
No it is not, if the teachers feel like it’s a problem, they are allowed to take anything till ethier end of the day or class.
Explanation:
Machine language, or machine code, is the only language that is directly understood by the computer, and it does not need to be translated. All instructions use binary notation and are written as a string of 1s and 0s.
A high-level language is a programming language that uses English and mathematical symbols, like +, -, % and many others, in its instructions. When using the term 'programming languages,' most people are actually referring to high-level languages. High-level languages are the languages most often used by programmers to write programs.
Examples of high-level languages are C++, Fortran, Java and Python.
High level languages are called ‘high-level’ because they are closer to human languages and
are further removed from machine languages than assembly language.
There is no one-to-one relationship between the instructions in a high level language and
machine language as there is with assembly language.
Difference between Machine Language and High Level language -
- In high level code instructions use words but In machine code instructions are in binary code.
- High-level code is designed to be read by human programmers but In Machine code is to be read/executed by the computer
- High level code can be portable/translated for different machines but Machine code is specific to a particular machine.
Answer:
i think Make variables to represent the length and width of a rectangle, called length
and width
, respectively. You should set length
to 10 and width
to 5.
Then, write some mathematical expressions to computer the area and perimeter of the rectangle and save these values inside variables named area and perimeter
.Use print
statements to display the area and perimeter of the rectangle.
Your output should print the area on the first line and the perimeter on the second, like this:
50 30 Rectangle Area Formula:
Area = L * W
Explanation:
Answer:
class Cse20_topic:
def __init__(self, title, length):
self.title = title
self.length = length
def get_length(self):
return self.length
def get_title(self):
return self.title
def get_length_in_days(self):
return self.length*7
def __str__(self):
return f'Title: {self.title}, length: {self.length}'
def __add__(self, other):
return self.length+other.length
Explanation:
The python program above defines the class Cse20 which is used to create a topic ( instance of the Cse20 object). The getter methods like the get_lenght, get_title and get_length_in_days return the length of a topic object, the title of the topic and the topic length in days respectively while the __str__ and __add__ methods overrides the string object and addition of topic length respectively.