google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.

Monday, August 25, 2014

Basic Programminng

The way we have different editions of a book ,a programming language also advances by each version .
BASIC also has many versions. John Kemeny and Thomas Kurtz originally developed it at Dartmouth College around the mid -1960 s.It soon became very popular because of its simplicity .Later ,others followed it and developed MS-BASIC,GWBASIC, BASICA and QBASIC.Initally ,Micrisoft Corporation developed MS-BASIC. Writing programs and getting results was a slow process  and to overcome this limitation ,Microsoft developed its faster version QBASIC .Full form of QBASIC is Quick Beginners All Purpose Symbolic Instruction Code.
It is simple and easily available.
QBASIC has an inbuilt editor .Editor helps in creating ,editing and storing text program files.We can create ,execute and debug a program without leaving QBASIC which speeds up our work.

How to start QBASIC :
It can be started as stated below :
1.By double clicking QBASIC icon on the desktop ,if it exists on the desktop .
2.Clicking on Start  -->Run and typing qbasic.exe along with its full path in the open text box thereafter confirming it by clicking on O.K.
Whichever way we start ,the welcome dialog box gets displayed first and which can be cleared by pressing the Esc key .Thereafter ,we can continue programming.

Rules of BASIC language :
1. Ther should be one satement per line .
2. If a statement does not fit in one line, we can continue it in the next line by inserting semicolon (;) at the end of the first line .
3. A statement should be completed in maximum two lines.
4. Each statement should be numbered .Normally we give number at the interval of 10 .First of all ,it is easy to write and secondly ,if need  arises ,we can insert a statement without changing the other line numbers.

Components of the BASIC language :
Our language comprises of sentences. A sentence is nothing but a combination of words ,and while combining these words ,we follow some rules and norms which we call grammar .Similarly ,any programming language has sentences like statements . These statements comprise of commands and expressions .We can combine commands and expressions to create a set of instructions (program ) which solves a particular program .Each programming language has its own rule for writing statements .Each statement should be written with proper order of command and expression ,which is termed as syntax .Each command has its own syntax.

Some BASIC commands:
1. REM
Syntax  :  <Line no>REM<text message>
Using the REM command ,we can write comments wherever required.

2. LET
Syntax  :  <Line no >LET<text message>
example:
LET A=20
LET SUM=A+B

3. INPUT
Syntax  : <Line no>INPUT<text message>
example:
INPUT "Enter name and age";Name$,AGE

4. PRINT
Syntax  : <Line no >PRINT<print item>separator<print item>......
To print more than 1 item ,we have to use separator like comma or a semicolon.
example :
50 PRINT X,Y,Z
60 PRINT "X=";X,"Y=";Y
70 PRINT
80 PRINT A;B;C

5. READ-DATA
Syntax : <line no>READ<variable 1,variable 2,....>
<line no>DATA<value 1,value 2,....>
example
40 READ name$,age
50 PRINT "Your name is";name$
60 PRINT "Your age is ";age
70 DATA "Vijay",40

6. GO TO
Syntax: <line no>GO TO<line no>
example :150 GO TO 50

7. IF...THEN...ELSE
Syntax: <line no>IF condition >THEN n

8. FOR.....NEXT:
Syntax: <line no> FOR<variable>=formvalue >TO <to value>STEP <value>
<statement to be repeated>


 <statement to be repeated>

<statement to be repeated>


NEXT <variable>

9.LOCATE
Syntax: <line no > LOCATE x,y

10 CLS
Syntax :CLS command clears the screen .Normally it is used to start the program .
Example: 10 CLS

11. END :This command is used to instruct the end of the program
example: 70 END



Program to find area of a circle :
10 CLS
20 REM Program to find Area of Circle.
30 INPUT "Enter Radius";R...
40 LET Area = 3.14 *R^2
50 PRINT "Area of Circle with radius "R;"is";Area
60 END

Program :FOR ...NEXT LOOP
10 CLS
20 REM Repeat Action
30 FOR I=1 TO 5
40 PRINT "I Love My India"
50 NEXT I
60 ENd
RUN  (For this Pres F5)
I Love My India
I Love My India
I Love My India
I Love My India
I Love My India

 Program to print the squares of first 50 odd numbers:
10 REM Program to print the squares of first 50 odd numbers
20 CLS
30 PRINT "Number","Square"
40 PRINT "-----------------"
50 FOR I=1 To 99 STEP 2
60 LET SQ=I^2
70 PRINT I,SQ
80 NEXT I
90 END

Output:
Number      Square
   1                  1
   3                  9
   5                  25
   7                  49
    .                  .
    .                  .
   97                 9409
   99                9801

Program to prepare a table of any number
5  CLS
10 REM Program to prepare table of any number
20 INPUT "Enter Any Number -",N
30 LET X=1
40 S=N*X
50 PRINT N;"X";X;"=";S
60 X=X+1
70 IF X<11 THEN GO TO 40 ELSE PRINT "OVER"
100 END
RUN ---------------(Press F5 key)
Enter Any Number -----------(Suppose we have entered  17)
We get output:
17x1=17
17x2=34
and so on
17x10=170
OVER

GRAPHICS IN BASIC
Program to draw a circle
10 CLS
20 REM Program to draw a circle
30 SCREEN 1
40 CIRCLE(70,85),25
50 END





Wednesday, August 13, 2014

MS-Excel



1)Specify any one type of charts available in spreadsheet.
 

Answer: 
Bar graph, Column graph, Pie chart, Line graph, etc.

2)Give any one built-in function of spread sheet.
 

Answer:
 SUM(range) : This function returns the sum of all the numbers
in the list of arguments.
Example: =SUM(A2:E2)



3)What are macros in ESS?
 

Answer:
 Macro is a small program that caries out pre-defined series of steps by giving a few
keyboard shortcuts.
Macro is like a batch file created in dos. It contains a series of commands.
When a macro is called and run, the instructions given in it are executed one by one.



4)Differentiate between MAX( ) and MIN( ) built-in functions in a spread sheet.
 

Answer: 
MAX(num 1, num 2,……) : Returns the largest value in a set of values.
Example: =MAX(15, 25, 8, 14) returns 25
MIN(num 1,num 2……) : Returns the lowest value in a set of values.
Example: =MIN(15, 25, 8, 14) returns 8



5)Explain briefly built in functions in spreadsheet.
 

Answer:
SUM(range) : this function returns the sum of all the numbers
in the list of arguments.
Example: =SUM(A2:E2)
ABS(number) : It returns absolute value of a number.
Example: =ABS(-35)=35
SQRT(number) : This function returns a positive square root.
Example: =SQRT(5) equals 2.1928.
AVERAGE(num 1, num 2……) : Returns the average of the set of numbers.
Example: =AVERAGE(15, 25, 50) returns 30.




6)Explain Arithmetic functions of MS-Excel.
 

Answer:
SUM(range) : this function returns the sum of all the numbers
in the list of arguments.
Example: =SUM(A2:E2)
ABS(number) : It returns absolute value of a number.
Example: =ABS(-35)=35
SQRT(number) : This function returns a positive square root.
Example: =SQRT(5) equals 2.1928.
PRODUCT(num1, num2…) : It returns the product of all the
numbers given as arguments.
Example: =PRODUCT(5,8,2)=80





7)Explain DATE functions used in spreadsheets.
 

Answer: 
DAY(serial number) : It returns the day of the days corresponding to serial number or
date.
Example: DAY (“5-jan”)=5
MONTH(serial number) : It returns the month corresponding to serial number or date.
Example: MONTH(“6-may”)=5
NOW( ) : This function returns the serial number of the current date and time.
DATE(year, month, day) : Returns the serial number of a particular date.
Example: DATE: (2005,3,23) returns 38434.




8)Briefly explain advantages of spreadsheet.
 

Answer:
i. Built-in Functions: It has rich set of built-in functions to perform all types of
calculations such as sum, max, abs, product, etc.,
ii. Copying formula: Similar formula can be copied into any number of cells.
iii. Fill series: It is used to fill automatically fill numbers or data in a series of cells.
iv. Sorting: The data can be arranged in a specific order in a table.



9)Explain Logical functions in Ms-Excel.

Answer:
1. AND(logical1, logical2………) : This function returns TRUE if all its
arguments are true, returns FALSE if one or more arguments are FALSE.
Example: =AND(3<5, 8=8) returns TRUE
=AND(3>5, 8=8) returns FALSE
2. OR(logical, logical 2………) : It returns TRUE if one or more arguments are
TRUE, returns FALSE if all its arguments are FALSE.
Example: =OR(3<5, 8<>8) returns TRUE
=OR(3>5, 8<>8) returns FALSE
3. NOT(logical) : Reverses the value of its arguments.
Example: =NOT(3<5) returns FALSE
=NOT(3>5) returns TRUE
4. If(logical-test, value1, value2) : It returns value1 if logical test is true. If logical test is
false it returns value2.
Example: =If(85>80, “Dist”, “I Class”) returns “Dist”
=If(40>50, 100, 200) returns 200





अच्छे विचार करे विचार

  पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...