Sunday, May 6, 2018

Qbasic Modular Programming Sequential Structure


SEQUENTIAL STRUCTURE
SET 1
1.      Write a program to calculate the volume of a cylinder using FUNCTION….END FUNCTION.[SEE MODEL 2065], [SLC 2071 S]
2.      Using FUNCTION….END FUNCTION, Write a program to calculate distance travelled by a body. (Hint: s=ut+ (1/2) at2) [SLC 2065R]
3.      Write a program using SUB…END SUB to get radius of circle and then print its area. [SLC 2065 S], [SLC 2071 R] [SEE 2074]
4.      Write a program using FUNCTION module to calculate and print the volume of a box. [SLC 2066 R]
5.      Write a program using FUNCTION…END FUNCTION to find the average of any two numbers given by the user. [SLC 2066 S]
6.      Using FUNCTION…END FUNCTION Write a program to calculate the average of three numbers. [SLC 2067 R], [SLC 2070 S]
7.      Write a program using SUB…END SUB to get radius of a circle and then print its circumference. [SLC 2067 S]
8.      Write a program to calculate the area of four walls using SUB…END SUB. [SLC 2068 R], [SEE 2073]
9.      Write a program in QBASIC to find the total surface area of a box using FUNCTION…END FUNCTION. [SLC 2068 S]
10.   Write a program to calculate and print the simple interest using FUNCTION…END FUNCTION. [SLC 2069 S]
11.   Write a program using FUNCTION…END FUNCTION to get temperature in celsius from the user and then print the temperature in fahrenheit.(hint: F=9C/5+32) [SLC 2070 R]
12.   Write a program using FUNCTION…END FUNCTION, to find the area of triangle. [SEE 2072]

SET 2
1.      Using FUNCTION…END FUNTION, write a program to calculate the sum and product of three numbers.
2.      Write a program in QBASIC to find square of a given number using FUNCTION…..END FUNCTION.
3.      Write a program in QBASIC to find cube root of a given number using FUNCTION…..END FUNCTION.
4.      Write a program using SUB……END SUB to find the area of rectangle. [A=L*B]
5.      Write a program using SUB……END SUB to find the perimeter of square. [P=4L]
6.      Write a program in QBASIC to find the area of four wall of a room using FUNCTION…..END FUNCTION.
7.      Write a program to convert USD(dollar) into NC (NEPALI currency) using DECLARE FUNCTION.
8.      Using Function…… End Function, write a program to calculate area and volume of hemisphere. [ volume = 2/3 πR3] .[ A= 2 * 3.14 * R ^ 2
9.      Write a sub program cost(l,b,h,c) to find the cost of painting the four walls of a room.
10.   Write a program to input cost price and selling price and calculate profit percentage using sub procedure. [P= ((SP-CP)/CP*100)]

SET 3
1.      Write a program using SUB…..END SUB to find the sum, difference, product and average of any two numbers given by the user.
2.      Write a program in QBASIC to find cube of a given number using SUB…..END SUB.
3.      Write a program in QBASIC to find square root of a given number using SUB…..END SUB.
4.      Write a program using FUNCTION……END FUNCTION to find the perimeter of rectangle. [P=2(L+B)]
5.      Write a program using FUNCTION……END FUNCTION to find the area of square. [A=L2]
6.      Write a function procedure to read the side of a cube. Calculate its volume and surface area. (Hint: vol=side3 and sa=6 side2]
7.      Write a program to input Fahrenheit and convert it into Celsius using SUB - END SUB.  Hint: C = (5/9)×(F-32)
8.      Write a program to convert NC (NEPALI currency) into IC (Indian Currency) using DECLARE SUB.
9.      Write a program to calculate the area of triangle by using SUB…..END SUB. [Hints: Area=]
10.   Write a function procedure to calculate volume and area of sphere.[ A= 4 * 3.14 * R ^ 2 ,
V = (4 / 3) * 3.14 * R ^ 3]


***

Saturday, April 7, 2018

Solved SEE 2074 [Computer Science]

Solved SEE 2074 [Computer Science]
Group A
Computer Fundamentals (22 Marks)
1. Answer the following questions: [5×2=10]
    a.  Define computer network.
        Ans: Computer network can be defined as a connection between computers and other
                 electronic devices to share the resources and information.
    b. Define Internet.
      Ans: A global computer network providing a variety of information and communication
               facilities is called internet.
    c. Write the importance of power protection device to protect computer system.
      Ans: The importance of power protection device to protect computer system are:
                i) To protect the hardware against damage from unexpected power failures.
                ii) To protect files and programs being corrupted due to sudden power failure.
    d. What is computer virus? Mention any two symptoms that can be seen when a computer is                     infected by computer virus.
          Ans: A computer program which is capable of copying itself and typically has a detrimental
                   effect, such as corrupting the system or destroying data. Or any other suitable answer.
                   Two symptoms of computer virus in a computer are:
                    i) Unexpected computer behavior
                    ii) Computer becomes slower
   e. What is cyber crime? Give any two examples.
        Ans: The criminal activities involving the information technology with the help of computer is
                 known as cyber crime.
                 Any two examples of cyber crimes are: software piracy and hacking

2.a) Perform the conversion as per the direction: [2×1=2]


  b) Perform the binary calculations: [2×1=2]


3. Match the following: [4×0.5=2]
     Group 'A'                       Group 'B'
   a) RJ 45 connector          i) Duplicate copy
   b) Backup                        ii) Multimedia
   c) Microphone                 iii) Twisted pair  cable
   d) Hub / switch                iv) Ring Topology
                                            v) Star Topology
Answers:

  Group 'A'                       Group 'B'
   a) RJ 45 connector          i) Twisted pair  cable
   b) Backup                        ii) Duplicate copy
   c) Microphone                 iii) Multimedia
   d) Hub / switch                iv) Star Topology
                                         
4. Select the best answer of the following: [4×0.5=2]
    a) Which of the following is not a network protocol?
         i) POP          ii) FTP         iii) TCP/IP        iv) NOS
         Ans: NOS
    b) Which of these software is used for photo editing?
         i) Ms-Excel          ii) Photoshop         iii) Power-Point       iv) MS-Word
         Ans: Photoshop
    c) Which device is used to connect multiple networks that use the same protocol
         i) Bridge          ii) NIC        iii) Switch       iv) Gateway
         Ans: Bridge
    d) Process of arranging the scattered files into a contiguous manner.
         i) Scandisk          ii) Backup         iii) Defragmentation        iv) Debugging
         Ans: Defragmentation

5. Write the appropriate technical terms of the following: [4×0.5=2]
   a) The physical layout of local area network.
       Ans: Topology
   b) The business conducted through internet.
       Ans: E-commerce
   c) The law which controls the crime which is done with the help of computer and Internet.
       Ans: Cyber law
   d) A computer or device which provides different services to other computers connected to the     
         network.
       Ans: Server

6. Write the full form: [4×0.5=2]
    a) SMTP: Simple Mail Transfer Protocol
    b) WAN : Wide Area Network
    c) URL : Uniform Resource Locator
    d) VOIP : Voice Over Internet Protocol

Group B
Database (10 Marks)

7. Answer the following questions: [3×2=6]
   a) Define database.
      Ans: Database can be defined as an organized collection of data which can be easily accessed,                     managed and updated.
   b) What is data redundancy? How can it be reduced in database?
       Ans: The repetition of same piece of data in a database in more than one location is called data                    redundancy. Data redundancy can be minimized by normalization of database.
   c) Mention any four data types that can be used in Ms-Access.
      Ans: Any four data types that can be used in Ms-Access are
               i) Text
               ii) Memo
               iii) Currency
               iv) Number

8. Select the correct answer: [4×0.5=2]
    a) Which if the following is not accepted by primary key?
         i) Number         ii) Text         iii) Null value        iv) None
         Ans: Null value
    b) Which is called rows in database table?
         i) Field          ii) Record         iii) Form       iv) None
         Ans: Record
    c) Which data type consumes the least storage space?
         i) Text          ii) Yes/No          iii) OLE object       iv) Memo
         Ans: Yes/No
    d) Which is the default data type of Ms-Access?
         i) Memo         ii) Number       iii) Text          iv) Auto number
         Ans: Text

9. Match the following: [4×0.5=2]
     Group 'A'                       Group 'B'
   a) Data                            i) Input, view, edit data
   b) Form                           ii) Formatted output
   c) Report                         iii) Collection of raw facts
   d) Table                          iv) Questions to the database
                                            v) Stores data in database

Answers:

Group 'A'                       Group 'B'
   a) Data                            i) Collection of raw facts
   b) Form                           ii) Input, view, edit data
   c) Report                         iii) Formatted output
   d) Table                          iv) Stores data in database

Group C
Programming (18 Marks)
                                       
10. a) What is formal parameter? [1]
      Ans: The variable which is used in the function definition is called formal parameter.
      b) List any two data types used in C programming language. [1]
      Ans: Any two data types used in C programming language are
               i) char
               ii) int
      c) Write the function of KILL and CLOSE statements. [1]
        Ans:   The function of KILL is to delete the file
                   The function  of CLOSE is to close any opened file

11. Re-write the given program after correcting the bugs: [4×0.5=2]

   REM TO find the factorial of a given number.
   DECLARE FUNCTION FACTO (N$)
   CLS
   INPUT "Enter a number"; X
   PRINT "The Factorial is: ", FACTO (N)
   END

   FUNCTION FACTO (N)
   F = 1
        WHILE N = 0
              F = F * N
              N = N - 1
        WEND
   F = FACTO
   END FUNCTION

Debugged Program:

REM To find the factorial of a given number
DECLARE FUNCTION FACTO (N)
CLS
INPUT "Enter a number", X
PRINT "The Factorial is :", FACTO (X)
END
FUNCTION FACTO (N)
F = 1
WHILE N > 0
F = F * N
N = N – 1
WEND
FACTO = F
END FUNCTION

12. Write the output of the following program: [2]

DECLARE SUB Display (T$)
CLS
T$ = "COMPUTER"
CALL Display (T$)
END

SUB Display (T$)
FOR C = 1 to LEN (T$) STEP 2
    D$ = MID$(T$, C, 1)
    PRINT D$;
NEXT C
END SUB

Output:
CMUE

13. Study the following program and answer the given questions: [2×1=2]

DECLARE FUNCTION SUM (N)
CLS
INPUT "Enter any number"; N
S = SUM (N)
PRINT "The Sum of individual digit is"; S
END

FUNCTION SUM (N)
   WHILE N > 0
       R = N MOD 10
       T = T + R
       N = N \ 10
   WEND
 SUM = T
END FUNCTION

a) State the purpose of suing variable S in line 4 in above program.
   Ans: Variable S is used to store the value returned by the function Sum.
b) Write the use of MOD in the above program.
    Ans: MOD is used to get the remainder of the division.

14. a) Write a program to calculate area of a circle using Sub......End Sub. [3]

            DECLARE SUB Area (r)
            CLS
            INPUT "Enter radius of circle", r
            CALL Area (r)
            END
         
           SUB Area (r)
             A = 3.14*r*r
             PRINT "Area of circle :" ; A
              END SUB

      b) Write a program using FUNCTION.....END FUNCTION to count the number of words in a                 sentence. [3]
       
           DECLARE FUNCTION WCount (S$)
           CLS
           INPUT "Enter a sentence", S$
           C = WCount (S$)
           PRINT "The number of words is :" ; C
           END

          FUNCTION WCount (S$)
          W = 1
          FOR I = 1 To LEN (S$)
          C$ = MID $ (S$, I,1)
           IF C$ = " " THEN W = W + 1
           NEXT I
          WCount = W
          END FUNCTION

      c) Write a program to store Roll no., Name, Class and Address of any five students. [3]

            OPEN "Student.dat" FOR OUTPUT AS #1
            FOR I = 1 TO 5
            INPUT "Enter Roll No.", r
            INPUT "Enter Name", n$
            INPUT "Enter Class", c
            INPUT "Enter Address", a$
            WRITE #1, r, n$, c, a$
             NEXT I
             CLOSE #1
             END
***

Answer Source of all SEE Questions 2074 : Click here
You can also download the SEE Questions 2074 by Clicking here










Monday, March 19, 2018

write a program by using QBASIC code to input name class and marks obtained in 3 subjects of any one student and calculate total, percentage and display them.


Write a program by using QBASIC code to input name class and marks obtained in 3 subjects of any one student and calculate total, percentage and display them.


CLS
INPUT “ENTER NAME”; N$
INPUT “ENTER CLASS”; C
INPUT “ENTER MARKS OBTAINED IN ANY THREE SUBJECTS”; A, B, C
T = A+ B+ C
P = T / 3
PRINT “YOUR NAME IS”;N$
PRINT “YOUR CLASS IS”; C
PRINT “YOUR OBTAINED MARKS ARE”; A, B, C
PRINT “TOTAL MARKS = “; T
PRINT “PERCENTAGE = “; P
END