PODAR INTERNATIONAL SCHOOL,AHMEDABAD
Question Bank 2019-20
Grade: VIII
Subject: Computer
1) An internal style sheet is defined in the HEAD section of the HTML page, inside the tag.
(a) <title> (b) <style>
(c) <body> (d) <font>
2) In a C program, "% c" indicates that the input value should be of
type.
(a) float (b)boolean
(c) integer (d)character
3)_____ is an input statement in ‘C’ that accepts the value from the user at runtime.
(a) scanf (b) printf
(c) getch() (d) clrscr()
4) In HTML and CSS, an id name and class name cannot start with
.
(a) alphabets (b) numbers
(c) symbols (d) punctuations
Q. II Do as directed
1)What will be the output of the following program in C if the user enter the age as 5?
#include<stdio.h>
#include<conio.h>
void main ( )
{int age;
printf("\nEnter the age of the child:");
scanf("%d", &age);
if(age==4)
{
printf("\nEligible for Jr KG");}
else if(age==5 || age==6)
{
printf("\nEligible for Sr KG");}
else
{printf("\nNot eligible for admission");}
}
getch();
}
Ans: Eligible for Sr KG
2) Given below is a C program to display the sum of first 10 natural numbers.
Identify the errors in the program. Rewrite the corrected program and
underline the corrected statement.
#include <stdio.h>
#include<conio.h>
void main()
{
int j, sum = 0;
printf("The first 10 natural numbers is :\n");
for (j = 1; j = 10; j)
{
sum = sum + j;
printf("%d ",j);
}
printf(\nThe Sum is : %d\n, sum) getch ( );
}
}
Ans: #include <stdio.h>
#include<conio.h>
void main()
{
int j, sum = 0;
printf("The first 10 natural number is :\n");
for (j = 1; j <= 10; j++)
{
sum = sum + j;
printf("%d ",j);
}
printf("\nThe Sum is : %d\n", sum);
getch ( );
}
}
Q. III Answer the following questions in short
1)What is the use of the break statement in ‘C’?
a)The break statement is used to come out of the switch block after executing
the statements for a particular case.
b)It should appear after every case, otherwise, all cases after the particular case
will also get executed sequentially.
2)Explain the effect of the following CSS code.
h1 { font-family: Ebrima; color:red;
text-align:center;
}
Ans: The above CSS code will display all headings created with H1 tag in Ebrima
font, red color and aligned at the center of the web page.
2) Write the CSS code only to display a background image . Use the following
information for the same. No repeatation
image file - "pic.jpg"
image position – left
Ans:<head>
<style> body
{
background-image: url("pic.jpg");
background-repeat: no-repeat;
}
</style>
</head>
3) Which looping statement of ‘C’ program is descried below?
a) It tests the condition first and if it is true,executes the statements inside the loop.
Ans while loop
b) It executes the statements inside the loop at least once and then checks the condition.
Ans: do while loop
4) What are the ‘broadcast’ and ‘receive’ blocks used for in Scratch?
Ans:
The broadcast block is used to send a messge from one sprite to another sprite
The receive block allows the sprite to receive the message broadcast by it or another
sprite.
Q. IV Answer the following questions
1) Explain how an internal stylesheet is defined with help of an example.
Ans) An internal style sheet is defined in the HEAD section of the
HTML page, inside the <STYLE> tag. It is used when a single
document has a unique style.
<head>
<style type=‛text/css‛>
hr {color: sienna;}
p { margin-right: 30px;}
body {background-image:url(‚images/background.gif‛); }
</style>
</head>
2) Write the appropriate Scratch blocks to be used in the following situations.
a) To store multiple values
Ans List
b) To tell the custom block what to do
Ans Define
c) To wait till all receiving scripts have ended before continuing with the
remaining script.
Ans Broadcast and wait
3) Write the CSS code to get the following output.
________________________
The heading has line above it
The heading has line above it
Ans
<style>
h1 {text-decoration: overline}
h2 {text-decoration: line-through}
h3 {text-decoration: underline}
</style>
4)Explain the following operations that can be performed on Lists in Scratch.
a)item last of material
Ans: This script will report the value of the lst item in the ‘Materials’ list.
b)Replace item last of materials with pebbles
Ans: This script will replace the last item in the ‘Materials’ list with ‘pebbles’.
c) length of materials
Ans: This script will report how many items are there in the ‘Materials’ list.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
No comments:
Post a Comment