Write a QBasic Program that accept the full name of the person and display the initial character of the first name and middle name with full family name.(eg.Meg Bahadur Thapa as M.B.Thapa)
CLS
INPUT "ENTER FULL NAME"; A$
B$ = LEFT$(A$, 1)
FOR J = 1 TO LEN(A$)
C$ = MID$(A$, J, 1)
IF C$ = " " THEN B$ = B$ + "." + MID$(A$, J + 1, 1)
NEXT J
FOR I = LEN(A$) TO 1 STEP -1
D$ = MID$(A$, I, 1)
F = F + 1
IF D$ = " " THEN
E$ = E$ + RIGHT$(A$, F - 2)
EXIT FOR
END IF
NEXT I
PRINT B$ + E$
END
SEE Computer Science Specification Table 2076, Networking and Telecommunication, Ethical and Social Issues in ICT, Computer Security, E-Commerce, Contemporary Technology, Number System, Database Management System (MS Access), Modular Programming, Sequential File Handling, C Programming Basics, SEE Computer E-Book Grade IX and X
Subscribe to:
Post Comments (Atom)
Thank u for uploading this post! It is really a big help.
ReplyDeleteI need MBT for Meg Bahadur Thapa
ReplyDeletehttps://seeqbasicomputer.blogspot.com/2019/10/138-qbasic-program-to-enter-long-string.html
DeleteYes i also need mbt
DeleteCLS
DeleteINPUT"full name"; N$
IN$= MID$(N$, 1, 1)
FOR I= 2 TO LEN(N$)
IF MID$( N$, I, 1)= " "THEN
IN$= IN$ + "."+ MID$(N$, i+1,1)
END IF
NEXT
PRINT"The initials";IN$
END
Thank you
ReplyDeletebut what if i want to print middle name only out of the three words
ReplyDeletehi
DeleteVery very tq sir it's big help for me .... Thanks a lot
ReplyDeleteI think this will work out.
ReplyDeleteCLS
s$ = "Laxmi Prasad Devkota"
PRINT LEFT$(s$, 1); ".";
FOR i = 1 TO LEN(s$) STEP 1
a$ = MID$(s$, i, 1)
IF a$ = " " THEN PRINT MID$(s$, i + 1, 1); ".";: EXIT FOR
NEXT i
FOR j = LEN(s$) TO 1 STEP -1
c$ = MID$(s$, j, 1)
IF c$ = " " THEN
PRINT RIGHT$(s$, LEN(s$) - j)
EXIT FOR
END IF
NEXT j
END
bro plz explain me qbasic :(
ReplyDeleteHE DONT KNOW HOW TO EXPLAIN
DeleteWrite a program to input the first name and last name of the user and print their full name.
ReplyDeletehello your program can be short and i have just a simple issue with your website that is i cannot copy and thing on your website so try to chance some of your codes and fix it other wise you may lost your viewers i just giving feedback
ReplyDeletethis program is holy wrong so don't copy it
ReplyDelete