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();
Let’s write the algorithm in the form of a pseudocode!
Pseudocode:Quotient_of_Two_Number
Declare: num1, num2, quotient
START
Display (Enter a number)
Read num1
Display (Enter a number)
Read num2
quotient = num1/num2
Print (“Quotient”)
STOP
Following are the correct Python program to calculate its output:
Program Explanation:
- Defining a method "returnNumber" that takes "x" variable in the parameter.
- Inside the method, a return keyword is used that multiplies the parameter value by 5 and returns its value.
- Outside the method, a print method is declared that calls the "returnNumber" method which accepts an integer value into the parameter.
Program:
def returnNumber(x):#defining a variable returnNumber that x variable in parameter
return x*5;#defining a return keyword that multiply the parameter value by 5
print(returnNumber(2))#calling method returnNumber that takes integer value in parameter
Output:
Please find the attached file.
Learn more:
brainly.com/question/13785329