Thursday, 27 February 2014

Class 7 - Line

The line statement is used to draw a line from a point to another.It can also be used to draw rectangular boxes. The points represent column and row.

Line (10,15) - denotes 10th column and 15th row.

For a horizontal line , only the column changes not the row.





For a vertical line , only the row changes not the column.


 
To draw a rectangle : Starting column and row are 100 and 100.
the second set of points are diagonally opposite points. 600 is the diagonally opposite column and 300 is the diagonally opposite row.
5 is the colour code, and B is the box code.
 



To draw a square:




 

Wednesday, 26 February 2014

Class 7 - Ch 6



Ch 6: Advanced Features of QBASIC

Exercise:

I.                   Fill in the blanks :

1.     String Functions

2.     For .. Next

3.     Exit

5.     String resolution

II.                State true or false:

1.     True

2.     False

3.     False

4.     True

5.     False

Practical Exercises :

1. For a=1 to 5

Print “BCBS”

Next a

End

 

2. For i=1 to 10

Print  “5 * “  ; i ;  “*” ;  5*i

Next i

End

 

In the above program we are printing  the table of 5.

In the print statement  5 *  is given within  double quotes, so it
 will be printed as it is. Then there is a semicolon(;) to give
space between the letters. * within quotation will be printed as
it is, then semicolon will give space and then finally 5*i will
give the multiplication value. Remember it is not within
quotation, because we don’t want it to be printed as it is but
we want the product.

3
         For x= 19 to 1 step - 2

Print x

Next x
        End







 4 a.

Screen  9

Line (10,10) – (150,60), 5,  B

Line (10,70) – (150,120), 5, B

Line(10,130) – (150, 180) , 5 , B

End                            

In this program we are drawing three rectangles one below the other. You can draw a square or a rectangle  using  4 Line commands without B, or you can follow the above method where we write only one statement for a square or a rectangle.

4 b.

Screen 9

Circle (100,100), 50

Circle (100, 250) , 50

End

 

 

 



Class 7


Ch 7 :  Creating Charts in MS Excel
Exercise :

I.                   Fill in the blanks :

1.     Data table

2.     Value

3.     Line

4.     Chart Title

5.     Layout

II.                State True or False :

1.     False

2.     False

3.     True

4.     True

5.     True

III.             Answer the questions :

1.     A chart is a graphic representation of data in the worksheet. It increases the readability and understandability  of data. A chart can also be used to compare a series of data over different time spans.

The five components of a chart are: data series, chart
 
title, plot area, gridlines and data labels.

2. The five types of charts are bar chart, pie chart, line chart, doughnut chart, and column chart.

5.  The different options available in layout tab are Format  
     selection, Picture, Shapes, Text box, Chart title, Axis
     titles, Legend, Data labels, Data table, Axes and
     Gridlines.

    

 

Saturday, 15 February 2014

Revision - Class 7

 
 
GRAPHICS
 
 
 
 
 

 

 

 
 

 

 
 
 

 

 

Revision - Class 6

BASIC

Constant :
Value which does not change.
There are two types :
1.     Numeric Constant
2.     String Constant
Numeric constant
Numbers negative, positive, decimal or whole numbers.
Example :
 -5
1345
78.12
String Constant
This is also called Alphanumeric constant. It consists of numbers or alphabets or special characters ,it is written within double quotes(“  “).
Example :
“Cottons”
“Bangalore”
“Exam March 2014”
Variable
1.     Numeric Variable
2.     String Variable
Numeric Variable:
A variable that holds the numeric constant.
Example :
A
X1
XY
String variable
The variable that holds the alphanumeric constant. This cannot be used for arithmetic calculations. This variable must end with a $ sign.
String Variable
String Constant
Must end with $
Must be enclosed within “ “
Eg: a$,  name$,  xy$
Eg: a, xy



Operators


·        Arithmetic Operators


·        Relational Operators


·        Logical Operators


Arithmetic Operators : We are going to use all the following operators in our program, for example multiplication is  *(asterisk) not x as we use in Maths.
Addition     +
Subtraction -
Multiplication *
Division      /
Exponential  ^
Relational Operators: They are used to perform comparisons.The relational operators will give TRUE or FALSE after comparision.
Less than              <
Greater than                   >
Less than or equal to     <=
Greater than or equal to >=
Equal to                         =
Not equal to                            < >
Logical Operators: They are also called Boolean Operators.
·        AND          
·        OR
·        NOT
Let us see how the logical operator works.
Imagine a condition for getting a scholarship, either you should score above 90 in Computer science or above 80 in Maths. Assume that you have scored 85 in Computers but 87 in Maths. It is very clear that you will get the scholarship.
Computer Science (C)
Maths (M)
Result (C>90) OR (M >80)
95
63
True
71
81
True
95
100
True
46
52
False
 
The second condition is you should score above 90 in Computer science and above 80 in Maths.
Computer Science (C)
Maths (M)
Result (C>90) AND (M >80)
95
63
False
71
81
False
95
100
True
46
52
False
 




 
Commands
1. Print Command:
It is used to display the output on the screen.
Example:
Print “Hi I am in Class 6”
Print 20 *5
The  first command is within the quotes since it is a string constant. The second command calculates the expression and gives the answer 100
Print with comma
Print with semicolon
Print with Colon
Empty Print - This gives an empty line.

 

INPUT

It accepts the values from the user through the keyboard.

Difference between LET and INPUT is :

If we are using LET command the values of the program remains the same, therefore whenever we execute(RUN) the program, the output remains the same.

If we are using INPUT command, different values can be given each time we execute the program.

To accept a number:

Input A

To accept a string:

Input A$
 

 

1. Write a program to enter the side and calculate the area of a square.

        (Area of square= side x side)


Print “Enter the side”


Input S
Let area= S * S
Print area
End

 
 
Note :
Print "Enter the side" and Input S can be combined into a single statement.
Input "Enter the side" ; S
 
2. Write a program to find the area of a rectangle.
      ( Area of rectangle= Length X Breadth)
 Print “Enter Length and breadth”
Input L, B
Let A=L * B
Print A
End
3. Write a program to enter 2 numbers and display the sum, difference, multiplication and division
Print “Enter 2 Numbers”
Input a,b
Let s=a+b
Let diff=a – b
Let M=a*b
Let D=a/b
Print “Sum=” ;s
Print “Difference=”;diff
Print “Product=”; M
Print “Division=”; D
end
 
Conditional statements

This will execute the statements based on a given condition. Computer cannot take any decision , so we should instruct the computer to take some action based on the condition given by the user.

·        If Then

·        If then else

IF THEN ELSE

Syntax:

If condition then

Statement 1

Else

Statement 2

End if

 Note:
If you are using If then syntax, it will take action for only one condition , but If then Else will give you an answer for both the true condition or false condition.

1.     Write a program to enter a number check whether it is positive or negative.

(A number is said to be positive if it is greater than 0 otherwise it is negative)

Print “Enter a number”

Input N

If N > 0 then

    Print “Positive”

Else

    Print “Negative”

End if

End

 

2.     Input two numbers and display the biggest number.

Print “Enter two numbers”

Input a, b

If a>b then

    Print a “is big”

Else

    Print  b “is big”

End if
 
            End
3. If the mark entered is below 45, then you should print Fail otherwise print Pass.

         Input "Enter your mark " ; M
  
         If M > = 45 then
 
            Print "Pass "
        
         Else
      
           Print "Fail"

         End if

        End