MY PROJECT ON
COMPUTER
1. Define Operator. List
its types with examples.
ANS: Operator are symbols,which are used for mathematical calculations , logical and string operations.It's type are:
1.Arithmetic Operator
Example:
PRINT A*B*C , PRINT T$+M$
, PRINT (A*B+(A^2)),etc.
2.Relational Operator
Example:
PRINT 5>3 , PRINT
9<>9 , PRINT 9=9,etc.
3.Logical Operator
Example:
PRINT 7>5 AND 8>7 ,
7>8 AND 8>7,etc.
4.String Operator
Example:
PRINT
"KATHMANDU"+"NEPAL" ,
"A"+"B"+"C" , etc.
2.Define
Operand. Explain with example.
ans:
Operands may be constant values or variables on which mathematical and logical
operations take place.For example: PRINT T=7+8 , PRINT A*B , PRINT
"ELISHA"+"TAMANG" , etc.
3.Define
Expression. List its types with examples.
ans: An
expression can be a single string or numeric constant,a variable or a
combination of constant and variables with operators.For example: PRINT 6>5 ,
PRINT A$+B$ , etc.
4.What is
Arithmetic Operator? Explain with examples.
ans: An expression,which
contains values,variables and operators that return a single numeric value
after operations is called arithmetic expression.For example: PRINT 7*6+5
, PRINT (8^2)*(6^2) , etc.
5.Discuss
about Operator Precedence.
Ans: In the presence of more
than one operator in QBASIC, QBASIC follows a certain order for performing the
operations. The order in which the QBASIC performs the operation is known as
operator precedence or hierarchy of operations.
The operator precedence in QBASIC is:
· * ()
· * ^
· *-
(negative)
· *
/
· * \
· *MOD
· *+,-
· *=
· *<>
· *<
· *<=
· *>
· *>=
· *NOT
· * AND
6.What
is Logical Operator? Explain with examples.
ans:
Logical operators are symbols,which are used to combine two or more logical or
relational expressions and return a single 'true' or 'false' value.For
example:PRINT 7>5 OR 6>8 , PRINT NOT(7>5) ,etc.
7.What is Relational
Operator? Explain with examples
ans: Relational
operators are symbols,which are used in relational or logical expressions.For
example:PRINT 5>3 , PRINT 9<>9 , PRINT 9=9 ,etc.
8.Show
the truth table of AND, OR and NOT operator.
ans: TRUTH TABLE OF NOT
operator
NOT
|
Operand
|
Result
|
TRUE
|
FALSE
|
|
FALSE
|
TRUE
|
TRUTH TABLE OF AND operator
AND
|
TRUE
|
FALSE
|
TRUE
|
TRUE
|
FALSE
|
FALSE
|
FALSE
|
FALSE
|
TRUTH TABLE OF OR operator
OR
|
TRUE
|
FALSE
|
TRUE
|
TRUE
|
TRUE
|
FALSE
|
TRUE
|
FALSE
|
9. What is
String Operator? Explain with examples.
Ans: String operator is a symbol like +(plus) which is used to
combine two or more string.For example: PRINT “KATHMANDU”+”NEPAL” , PRINT “ELISHA”
+” ”+”TAMANG”,etc.
10. Write any ten possible conditions or Boolean
expressions that exist between A and B, where A=12 and B=13.
Ans:
*A=B
*A>B
*A<B
*A<>B
*A>=B
*A<=B
*A>B OR A<B
*A<B OR A>B
*NOT A<B
*NOT A<B
11. Define numeric data and string data. Give
examples also.
Ans: All the negative and positive numbers are
numeric data.For example:9,11,-45,etc.
String is a text value that consists of alphabets,numbers and other
special symbols.For example:”KATHMANDU” , “NEPAL”,etc.
12. What is constant? List its type with
examples.
Ans: Constant
are the value which remains fixed during execution of program.
Its types with example are:
*Numeric constant
Example: CONS PI=3.14
*String constant
Example:”XYZ”,”POKHARA”,etc.
13.
Define string and numeric constant with examples.
Ans: String constant is a text value that consist of
alphabets,digits,symbols and other special characters.For exaple:”XYZ”
Numeric constant is known
as all numeric values.For example:122200,450,etc.
14. What is variable? List its type with examples.
Ans: Variable
is a identifier or reference or name for memory address and can change the value
during execution of program.
It's types with example are listed below:
*Numeric variable
For example:A10,A13%,etc.
*String variable
For example: ADDRESS$=”LALITPUR”, NAME$=”ELISHA”,etc.
15.Define
string and numeric variable with examples.
Ans: A string variable is a name or reference or memory
location which stores alphanumeric characters. For example: ADDRESS$=”LALITPUR”,
NAME$=”ELISHA”,etc.
Numeric variable is a name or reference
which stores a positive or negative number.For example: A10,A13%,etc.
16. Write the characteristics of variable.
Ans:The characteristics of variable are:
*A variable name must
start with an alphabet (A to Z,a to z).”A10” is a valid variable name.
*A variable name may
have 1 to 40 characters in length.
*A variable name should
not contain a blank space or special characters other than
letters,numbers,periods(.)and the data type declaration symbol($,%,& and!).”A10”
is an invalid variable;e name because of it's space.
* A variable name must
not start with”FN”, because it is reserved word for the user-defined function.”FNnum”
is an invalid variable name.
*Other reserved words
or keywords of QBASIC are not allowed to use as a variable name.For example,”LET”
is an invalid variable name because “LET” is a reserved word of QBASIC.
17. List
any four rules for naming variable.
Ans: The four rules for naming variable are:
1. A
variable name must start with an alphabet.
2. A variable name may have 1 to
40 characters in length.
3. A variable name must not
start with FN because it is reserved word in qbasic.
4. Other reserved
word or keyword of qbasic is not allowed to use as variable.
18. What are the types of numeric variable? Explain with example.
Ans: The
types of numeric variable are:
1. Integer
Example: n%=125
2. Long integer
Example:
a&, amount& etc
3. Single precision
Example:
num!=1234
4. Double Precision
Example: num#=4567
19. Define implicit and explicit declaration of variable with example.
Ans:
Implicit :
Implicit :
Declaration of variable at the place of
assigning a value to variable is called implicit declaration of variable.
Explicit:
Declaration of variable
before you use it or before assigning data to a variable in a program is called
explicit declaration of variable.
20. Write short notes on Qbasic.
Ans:
QBASIC is a high level language developed by Microsoft. In 1985 Microsoft release their own version of BASIC called QBASIC. It was release with MS-DOS 5.0 operating system. It contains two files: QBASIC.exe and QBASIC.hlp.
QBASIC is a high level language developed by Microsoft. In 1985 Microsoft release their own version of BASIC called QBASIC. It was release with MS-DOS 5.0 operating system. It contains two files: QBASIC.exe and QBASIC.hlp.
Nessun commento:
Posta un commento