Sie sind auf Seite 1von 3

Sagay National High School

TLE Department
4th Periodical Examination
Computer Science (Grade 7)

Name: _____________________________________ Year & Section: _________________ Rating: ___________

I. Choose the letter of the correct answer. Write your answer on the blank provided.
_____ 1. Computer is a machine that accepts input, processes it using a set of ___________ and produces output.
a. computer parts c. information
b. data d. instructions
_____ 2. It is raw, unorganized facts that need to be processed.
a. computer parts c. information
b. data d. instructions
_____ 3. When data is processed, organized, or presented in a given context so as to make it useful, it is called ___________.
a. computer parts c. information
b. data d. instructions
_____ 4. A certain program uses a variable “name” which saves the name of the user. What is its appropriate data type?
a. boolean c. integer
b. character d. string
_____ 5. A certain program uses a variable “age” which saves the age in years of the user. What is its appropriate data type?
a. boolean c. integer
b. character d. string
_____ 6. A certain program uses a variable “mi” which asks the user’s middle name initial. What is its appropriate data type?
a. boolean c. integer
b. character d. string
_____ 7. Yes or NO, True or False, or data with only two possible values. What is its data type?
a. boolean c. integer
b. character d. string
_____ 8. Temperatures, salaries, and account payments are data with computations of numbers. What is its data type?
a. boolean c. integer
b. double d. string
_____ 9. Name of a person, address, education background, and work history. What is its data type?
a. boolean c. integer
b. double d. string
_____ 10.C++ is used to create programs. It is a computer ______________ language.
a. low - level c. programming
b. high - level d. assembly

II. Fill-in the blanks to complete the following programs.


“Program Hello World”
11. #include <____________>
12. using namespace _______;
int main()
13. _____
cout <<"Hello World";
14. system("_________");
15. return _______;
}
III. Calculate the possible value of the variable.

16. ftemp = ( 9 / 5 * ctemp ) + 32 ftemp = __________ ctemp = 100


17. square = num * num square = _________ num = 100
18. num = 5 + 3 – 1 * 4 num = ___________
19. num = ( 5 + 3 – 1 ) * 4 num = ___________
20. peso = 50.18 * dollar peso = ___________ dollar = 100
IV. Analyze and write the output of the following codes. (Use 100, and character A as the input) (5 points each)
21. – 25.
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<”Input a number and press Enter: ”;
cin>>n;
cout<<”The square of the number is: ” <<n*n <<endl;
system(“PAUSE”);
return 0;
}
26. – 30.
#include<iostream>
using namespace std;
int main()
{
char c;
cout<<”This program asks for a character and displays it.”;
cout<<endl;
cout<<”Please enter a character: ”;
cin>> c;
cout<<”You entered ” <<c <<endl <<endl;
system(“pause”);
return 0;
}

V. Decide the data type of the following variables (int, double, char, string, boolean).
Variables Data Type
Number of students in a section 31.
Room temperature in a classroom 32.
Height of the student in meters 33.
Weight of the student in kilograms 34.
Name of the student 35.
Home address of the student 36.
Gender of the student in (M, or F) 37.
4Ps beneficiary (Yes or No) 38.
Hobbies 39.
Year and Section 40.

VI. Construct the pseudo code of the program below. (items 41 - 50)
1 US Dollar = 50.18 pesos
Use variables: peso and dollar as double

This program converts a US Dollar


to a Philippine Peso.

Enter US Dollar value: 100

The Philippine Peso is 5018.


Press any key to continue…
Prepared by:

Ro me o P. Op e naJr
TLE – ICT Teacher

Das könnte Ihnen auch gefallen