Answer:
BEGIN
SET count = 1
WHILE count <= 12 THEN
INPUT length
perimeter = length * length
PRINT perimeter
END WHILE
END
Explanation:
You can also set count to 0 and in while loop use count < 12 to loop just 12 times just as above
Answer:
The function definition to this question can be given as:
Function definition:
void printAttitude(int x1) //define function printAttitude.
{
//nested else-if statements
if(x1==1)
//if block
cout<<"disagree"<<endl;
//message
else if(x1==2)
//else if block
cout<<"no opinion"<<endl;
//message
else if(x1==3)
//else if block
cout<<"agree"<<endl;
//message
else
cout<<" ";
}
Explanation:
In the above method definition firstly, we define a method that is "printAttitude". In this method, we pass an integer variable that is "x1". This function does not return any value because its return type is void. In this method, we use nested else-if statements. The description of these conditions can be given as:
- In the if block we check the variable x1 value is equal to 1 If this condition is true. It will print "disagree" otherwise it will go to else-if block.
- In the else-if block, we check the variable x1 value is equal to 2 if the condition is true. It will print "no opinion". otherwise, we will go to another else-if block.
- In this block, we check the variable x1 value is equal to 3 if this condition is true. It will print "agree".otherwise it will go to else block.
- In the else block it will print nothing.
Answer:
Since no programming language is stated, python will by used.
Explanation:
def isPrime():
#first we ask for a number that will be tested
data= int(input("please enter a number"))
#the next line is where the number will be tested to see if its a prime
if (data>1):
if(data % 2)==1:
print("true")
else:
print("False")
else:
print("Enter a number greater than 1")
isPrime()
Answer:
The answer is "URL".
Explanation:
The term URL is also known as the "Uniform-Resource-Locator", which is also known as the address of the website or internet file. To access this file we use to type its address in the web browser by using the "http:// or https://" protocol. It contains the domain name, with several other basic data to guide a visitor to a certain internet website called a web page.