-->
Showing posts with label QBasic programs. Show all posts
Showing posts with label QBasic programs. Show all posts

Wednesday, July 23, 2025

Qbasic program to find area of rectangle and circle using sub and function procedure | SEE computer science datafile program

 

QBasic programs collection-Especially for SEE (Grade-10)

QBasic procedure based programming  questions asked in Triton's model questions

QBasic programs [Triton's model set-I]

declare sub area_rectangle(l,b)

declare function area_circle(r)

Input "enter length and breadth of rectangle"; l, b

Input "enter radius of circle"; r

Call area_rectangle(l, b)

Print "the area of circle is"; area_circle(r)

End

Sub area_rectangle (l, b)

    area = l * b

    Print "the area is"; area

End Sub


Function area_circle (r)

    area_circle = 3.14 * r ^ 2

End Function




Tuesday, July 22, 2025

Qbasic program to read the contents of a datafile | SEE computer science datafile program

 

QBasic programs collection-Especially for SEE (Grade-10)

QBasic procedure based programming  questions asked in Triton's model questions

QBasic programs [Triton's model set]

'q9(b) triton SEE model set set II

Open "record.dat" For Input As #11

Cls

c = 0

While Not EOF(11)

    Input #11, sno, name$, address$, tel, email$

    If LCase$(Right$(email$, 9)) = "yahoo.com" Then

        c = c + 1

        Print name$, address$, email$

    End If

Wend

Print "total records having email is="; c

Close #11

End



Monday, July 14, 2025

SEE Computer Science: sub procedure program – QBASIC Sub Procedure Program Explained-2081 BS

 

QBASIC programs collection

Sub  procedure program [Triton model question-2081 set V q5]

DECLARE SUB SENDUP (S$)

E$ = "NPABSON"

Call SENDUP(E$)

End

Sub SENDUP (S$)

    For i = 1 To Len(S$) Step 1

        If i Mod 2 <> 0 Then

            EE$ = EE$ + LCase$(Mid$(S$, i, 1))

        Else

            EE$ = EE$ + UCase$(Mid$(S$, i, 1))

        End If

    Next i

    Print EE$

End Sub


SEE Computer Science: sub procedure program – QBASIC Sub Procedure Program Explained-2079 BS

 

QBASIC programs collection- 2079 B.S. GP

Sub and function procedure program [Triton model question]


'rem q9 A 2079 GP

declare sub perimeter(l,b)

declare function area(l,b)

Cls

Input "enter length and breadth"; l, b

Call perimeter(l, b)

Print "the area is"; area(l, b)

End

Sub perimeter (l, b)

    p = 2 * (l + b)

    Print "the perimeter is"; p

End Sub

Function area (l, b)

    area = l * b

End Function


Sunday, July 13, 2025

SEE Computer Science: Triton Model Set II – QBASIC Sub Procedure Program Explained

 

QBASIC programs collection- Triton model sets-II 

Sub procedure program

DECLARE SUB SERIES ( )

Cls

Call series

End

Sub series

    A$ = "NEPAL"

    B = 1

    For I = Len(A$) To 1 Step -2

        If B <> 3 Then

            Print Mid$(A$, B, I)

        Else

            Print Mid$(A$, 1, I)

        End If

        B = B + 1

    Next I

End Sub


Qbasic program to use sub and procedure and to find volume and TSA | SEE computer science procedure program

 

QBasic programs collection-Especially for SEE (Grade-10)

QBasic procedure based programming  questions asked in Triton's model questions

QBasic programs [Triton's model set]

'q9 triton SEE model set set II

declare function volume(l,b,h)
declare sub TSA(l,b,h)
Input "enter l,b,and h"; l, b, h
Call TSA(l, b, h)
Print "the volume is"; volume(l, b, h)
End
Function volume (l, b, h)
    volume = l * b * h

End Function
Sub TSA (l, b, h)

    total_surface_Area = 2 * (l * b + b * h + l * h)
    Print "tsa="; total_surface_Area
End Sub

Qbasic program to read the contents of data file record.dat and to print on screen | SEE computer science datafile program

QBasic programs collection-Especially for SEE (Grade-10)

QBasic Datafile programming of questions asked in Triton's model questions


QBasic program read the contents of datafile and display on screen [Triton's model set]

 

'q9(b) triton SEE model set set II

Open "record.dat" For Input As #11

Cls

c = 0

While Not EOF(11)

    Input #11, sno, name$, address$, tel, email$

    If LCase$(Right$(email$, 9)) = "yahoo.com" Then

        c = c + 1

        Print name$, address$, email$

    End If

Wend

Print "total records having email is="; c

Close #11

End


Monday, June 30, 2025

Qbasic program to read the contents of data file emp.dat and to print on screen | SEE computer science datafile program reading

 


QBasic programs collection-Especially for SEE (Grade-10)


QBasic Datafile programming of questions asked in 2080



QBasic program read the contents of datafile and display on screen SEE 2080 B.S.


Open "emp.dat" For Input As #12

While Not EOF(12)

    Input #12, name$, address$, gender$, salary

    If salary > 60000 Then

        Print name$, address4, gender$, salary

    End If

Wend

Close #12

End




Sunday, June 15, 2025

Qbasic program to know the output using dry run table | SEE computer science programming guide in Qbasic -to know the greater number

 

QBasic programs collection-Especially for SEE (Grade-10)



QBasic program to know the output of program using dry run table- to find the greater number, using sub procedure


declare sub pabson(A,b)

Cls

x = 15

y = 10

Call pabson(x, y)

Call pabson(3, 6)

End

Sub pabson (a, b)

    If a < b Then

        Print a

    Else

        Print b

    End If

End Sub








Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic -to find sum of numbers using function procedure

QBasic programs collection-Especially for SEE (Grade-10)

QBasic program to know the output of program using dry run table- to find the sum of numbers given as 1,2,3,4,5, using function procedure

declare function num(A)

Cls

For x = 1 To 5

    Read n

    s = s + num(n)

Next x

Print s

Data 1,2,3,4,5

End

Function num (a)

    num = a ^ 2

End Function

output:-


program to find the output of given program


Qbasic program to get output using dry run table and to write a program using | SEE computer science programming guide in Qbasic

 


QBasic programs collection-Especially for SEE (Grade-10)



QBasic program to convert a string into uppercase using function procedure

'wap to input a string in lowercase and convert that into uppercase

'use function procedure

declare function uppercase$(a$)

Cls

Input "ente a string"; a$

Print "string in upper case is="; uppercase(a$)

End

Function uppercase$ (a$)

    uppercase$ = UCase$(a$)


End Function


Wednesday, June 11, 2025

Qbasic program to find area and perimeter using function and sub procedure | SEE computer science programming guide -2078 questions

 


QBasic programs collection-Especially for SEE (Grade-10)





Qbasic program to find area and perimeter using function and sub procedure ;Question asked in 2078 B.S.

'q9 a to find area and perimeter using sub and function procedure

Declare sub perimeter(l,b)

declare function area(l,b)

Cls

Input "enter l and b"; l, b

Call perimeter(l, b)

Print "the area is"; area(l, b)

End

Sub perimeter (l, b)

    p = 2 * (l + b)

    Print "the perimeter="; p

End Sub

Function area (l, b)

    area = l * b

End Function

output:

program to find area and perimeter



Tuesday, June 10, 2025

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic -to find sum of numbers divisible by 4

 

QBasic programs collection-Especially for SEE (Grade-10)



QBasic program to know the output of program using dry run table- to find the sum of numbers between 1 and 20 and which are divisible by 4, using sub procedure



declare sub sum(A)

A = 2

Call sum(A)

End

Sub sum (A)

    While A <= 20

        If A Mod 4 = 0 Then

            s = s + A

        End If

        A = A + 1

    Wend

    Print s

End Sub

Dry run table

A

While A<=20

        If A Mod 4 = 0

S=s+A

A=A+1

2

yes

no

 

A=3

3

yes

no

 

A=4

4

yes

yes

S=s+A=0+4=4

A=5

5

yes

no

 

A=6

6

yes

no

 

A=7

7

yes

no

 

A=8

8

y

yes

S=4+8=12

A=9

9

yes

n

 

=10

10

yes

n

 

=11

11

yes

N

 

=12

12

yes

y

=12+12=24

A=13

13

yes

n

 

=14

14

yes

n

 

=15

15

yes

n

 

=16

16

yes

y

=24+16=40

=17

17

yes

n

 

=18

18

yes

n

 

=19

19

yes

n

 

=20

20

yes

y

=40+20=60

21

21

no

 

 

 


output:60

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic -to find sum of 1 to 9 with 2 step increment

 QBasic programs collection-Especially for SEE (Grade-10)


QBasic program to know the output of program using dry run table- to find the sum of numbers between 1 and 9 using function procedure

declare function find()

Print find

End

Function find ()

    For n = 1 To 9 Step 2

        Let s = s + n

    Next n

    find = s

End Function

Dry run table

N=1 to 9 step 2

S=s+n

find

 

N=1;true

S=0+1=1

 

 

N=3;true

S=1+3=4

 

 

N=5;true

S=4+5=9

 

 

N=7;true

S=9+7=16

 

 

N=9;true

S=s+N=16+9=25

 

 

N=11;false

 

Find=s=25

 


output

25

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic - for given numeric pattern 5,55,555


QBasic programs collection-Especially for SEE (Grade-10)


QBasic program to know the output of program using dry run table- to print the numeric pattern 5,55,555 etc

'CDC model question set 1

declare sub Result()

Call result

End

Sub result ()

    N = 5

    C = 1

    While C <= 5

        Print N

        N = N * 10 + 5

        C = C + 1

    Wend

End Sub


Dry run table with output


N

C

C<=5

Print N

N=N*10+5

C=c+1

5

1

yes

5

=5*10+5=55

2

55

2

yes

55

=55*10+5=555

3

555

3

yes

555

=555*10+5=55555

4

5555

4

yes

5555

=5555*10+5=55555

5

55555

5

yes

55555

=55555*10+5=555555

6

555555

6

no

 

 

 


output:

5

55

555

5555

55555


Monday, June 9, 2025

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic - to know the output

 


QBasic programs collection-Especially for SEE (Grade-10)





QBasic program to know the output of program using dry run table- to print the characters from given string


DECLARE SUB CHEMISTRY()

Cls

Call CHEMISTRY

End

Sub CHEMISTRY ()

    Let A$ = "VIDEO"

    Let B = Len(A$)

    For I = 1 To 4

        Print Mid$(A$, I, B)

    Next I

End Sub

DRY RUN table with output is given below

A$

B=LEN(A$)=5

I= 1 TO 4

MID$(A$,I,B)

VIDEO

B=5

I=1

MID$(A$,I,B)=VIDEO

 

B=5

I=2

MID$(A$,I,B)=IDEO

 

B=5

I=3

MID$(A$,I,B)=DEO

 

B=5

I=4

MID$(A$,I,B)=EO


output:

VIDEO

IDEO

DEO

EO

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic - to know the output

 

QBasic programs collection-Especially for SEE (Grade-10)


QBasic program to know the output of program using dry run table- to extract characters and print them


DECLARE FUNCTION OUTPUTT$(W$)

Cls

W$ = "CRIMES"

Print OUTPUTT$(W$)

End

Function OUTPUTT$ (W$)

    For M = Len(W$) To 1 Step -2

        M$ = M$ + Mid$(W$, M, 1)

    Next M

    OUTPUTT$ = M$

End Function


DRYRUN table for above program is given below

W$

M=6 TO 1 STEP-2

M$=M$+MID$(W$,M,1)

OUTPUTTT$

 

 

CRIMES

M=6

M$=S

 

 

 

 

M=4

M$=S+M=SM

 

 

 

 

M=2

M$=SM+R=SMR

SMR

 

 

Output:-

SMR