Grade VI, Chapter 6

    

Learn with Hafiza Palwasha


OXFORD (Book 6), KEYBOARD
Computer Science With Application Software (Third Edition).

Solution

Chapter No. 6
Basics in MS Small Basic

NEW WORDS
Students should extract new words by themselves from chapter No. 1 and write them on neat copies as vocabulary words. There is no need to memorize these words but students should be able to read and understand these words as I explained and discussed in class.

NEW TERMS AND ABBREVIATIONS
Students should learn these terms and abbreviation. It will be the part of exam.
1.    MS Small Basic:
       MS Small Basic is a software developed by Microsoft Corporation. It is the version of BASIC computer language.
2.    BASIC:
       BASIC stands for Beginner's All-purpose Symbolic Instruction Code.
3.    Property:
       It tells the characteristic of any object.
4.    Expression:
       When operators i.e +, -, *, / etc and operands i.e variables and constants are combined, they form expressions.
5.    Syntax:
       It is the particular style with which we can write statement according to the coding rules understandable in computer language.
6.    Program:
       A program is a set or sequence of instructions that is written to perform particular task.

Exercise
Solution

Page No. 104
Objective Type Questions
Q No. 1: Choose the correct option.
Solution:
a.   The arithmetic operator not used in Small Basic is
       iii. ^ (is correct)
b.   The output of the arithmetic expression 6 + 5 * 2 is
       i. 16 (is correct)
c.   The output of Math.Remainder (30, 8) is
       ii. 6 (is correct)
d.   The symbol used for inserting comments in a program is
       ii. ' (is correct)
e.   The method used to read numeric value during program execution is
       ii. ReadNumber ( ) (is correct)

Page No. 104
Descriptive Type Questions
Q No. 1: Answer the following.
a. What are the main points to be kept in mind while working in Small Basic?
Answer: The main points to be kept in mind while working in Small Basic:
1.   All commands should spell correctly.
2.   Reserved keywords not be used anywhere in the program.
3.   It is case-sensitive.

b. What are the rules for naming variables?
Answer: Following are the rules for naming variables:
1.   It includes letters, numbers and underscore.
2.   Fiirst character of variable should be number.
3.   It should not be the reserve word.

c. Explain the two types of variable in Small Basic?
Answer: Two types of variables in Small Basic are:
1.   Numeric ----- Floating is a type of numeric.
2.   String.

d. How will you write a comment in a Small Basic program?
Answer: We use apostrophe ( ' ) to write a comment in a Small Basic program.

e. What is the difference between WriteLine ( ) and Write ( ) methods?
Answer:

f. What is the order of execution of an arithmetic expression if there are nore than one arithmetic operators.
Answer: Following is the order of execution of an arithmetic expression if there are more than one arithmetic operators:
1.   ( ) Parenthesis.
2.   * Multiplication and / division.
3.   + Addition and subtraction.

g. Programmers often use conditional statements when coding. Based on what you have learned about conditional statements, evaluate the usefulness of the If-Then, If-Then-Else, and If-Then-ElseIf statements.
Answer: Conditional statements based on the 'true' or 'false' condition of any statement.
1.   If-Then:
       If 'true'
       then go ahead
          Example:
           If: weather is Sunny = True.
           Then say 'It's hot'.
2.   If-Then-Else:
       If 'true'
       then go ahead
       Else stay at false
          Example:
           If: weather is Sunny = True.
           Then say 'It's hot'.
           Else say 'It's cloudy'.
3.   If-Then-ElseIf:
       If 'true'
       then go ahead
       Else if other statement
       then go ahead
       Else stay at false
          Example:
           If: weather is Sunny = True.
           Then say 'It's hot'.
           Else if weather is cloudy and windy = True.
           Then say 'It's cold'.
           Else say 'It's pleasant'.

h. For each one of the examples given below, distinguish which operator would be used. Give reasons for your answers.
* Given that Sajid(S) is 10 years old and Amir(A) is 11, analyse the statement: S >= A
* (10*4) + 6
* Ali(A) has 10 chocolates, Bilal (B) has 23, and Sarwat (S) has 35; analyse the statement: A>B AND B<>S
Answer: *   '> =' is comparison operator.
*   '*' and '+' are the arithmetic operators.
*   '>' AND '<>' are logical statements. Here are two comparison statements.

h. Your teacher has asked you to find out how many students, under the age of 14, bring lunchboxes from home. Write a program which collects the data and displays the desired output.
Answer: Lab work (will be discuss in Computer lab. Students do not have to do this question on neat copies).

Additional Questions
Q: Solve the arithmetic expression for arithmetic operators.
          y = (2 * 5) / 5 - 3 + (5 + 7)
Answer: y = (2 * 5) / 5 - 3 + (5 + 7)
y = 10 / 5 - 3 + 12
y = 2 - 3 + 12
y = -1 + 12
y = 11

Comments

Post a Comment