-->
Showing posts with label function procedure. Show all posts
Showing posts with label function procedure. Show all posts

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, June 15, 2025

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


Tuesday, June 10, 2025

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