Input "enter name" ;n$
input "enter marks" ; m
ifm > 40 then print n$, "pass"
else print n$, "fail"
In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.
Yes. I can write a python program that asks for your name and then prints "Hi, name, good to meet you." by writing the following program.#!/usr/bin/pythonname = input("What is your name? ")print("Hi", name + "," , "good to meet you.")If I change the third line toprint("Hi", name + ",", "good to meet you. Your name is", len(name), "letters long.")It will say "Hi name, good to meet you. Your name is xletters long.", thus making it a different program.
you need strings to print any character(your name) this is not possible useing array:D
DIM grade(6), lowGrade(5), testName$(6), seq$(6) seq$(1) = "first " seq$(2) = "second" seq$(3) = "third " seq$(4) = "fourth" seq$(5) = "fifth " grLetter$ = "ABCD" begin: COLOR 7, 0 CLS PRINT "Test averaging program" PRINT "======================" PRINT PRINT "Lets enter some basic info before we get started .." PRINT FOR ix% = 1 TO 4 PRINT "enter a number (1-100) that you consider to be the lowest "; MID$(grLetter$, ix%, 1); INPUT lowGrade(ix%) PRINT STRING$(78, "-") NEXT ix% enterTests: COLOR 7, 0 CLS LINE INPUT "Enter student name or / to end program: "; name$ IF name$ = "/" THEN CLS END END IF LINE INPUT "Enter student age : "; age$ age% = VAL(age$) PRINT STRING$(78, "=") FOR ix% = 1 TO 5 PRINT "Enter the subject name for the "; seq$(ix%); " test: "; LINE INPUT testName$(ix%) LINE INPUT "Enter the grade for this test (1-100): "; grade$ grade(ix%) = VAL(grade$) PRINT STRING$(78, "-") NEXT ix% CLS displayReport: COLOR 7, 0 CLS GOSUB computeAverage PRINT "Test Average Report for "; name$ PRINT PRINT "Age is "; age$ IF (age% >= 25) = 0 THEN COLOR 6, 0 PRINT " ** Student is underage **" END IF COLOR 7, 0 stuGrade = average GOSUB determineAthruF PRINT "Test average is"; PRINT USING "###.##"; average PRINT "This is a grade of "; grade$ IF grade$ = "F" THEN COLOR 4, 0 PRINT "** Student did not pass **" END IF COLOR 7, 0 PRINT PRINT "Test Summary (those in "; COLOR 4, 0 PRINT "red"; COLOR 7, 0 PRINT " are failing)" PRINT FOR ix% = 1 TO 5 COLOR 7, 0 stuGrade = grade(ix%) GOSUB determineAthruF rptName$ = SPACE$(25) MID$(rptName$, 1) = testName$(ix%) IF grade$ = "F" THEN COLOR 4, 0 END IF PRINT rptName$, grade$, PRINT USING "###.##"; stuGrade NEXT ix% COLOR 7, 0 PRINT LINE INPUT "Do you wish to average another student (Y/N) "; yn$ yn$ = UCASE$(yn$) IF yn$ = "Y" THEN GOTO enterTests END IF END computeAverage: total = 0 FOR ix% = 1 TO 5 total = total + grade(ix%) NEXT ix% average = total / 5 RETURN determineAthruF: IF stuGrade >= lowGrade(4) THEN grade$ = "D" IF stuGrade >= lowGrade(3) THEN grade$ = "C" IF stuGrade >= lowGrade(2) THEN grade$ = "B" IF stuGrade >= lowGrade(1) THEN grade$ = "A" END IF END IF END IF ELSE grade$ = "F" END IF RETURN
I was able to create a login program in qbasic with this simple code: cls 1 input "Username: " , username$ if username$ <> "Define what you want your name to be here (use the quotes)" then goto 1 else input "Password: " , password$ if password$ <> "Again define using quotes" then goto 1 else print "You have successfully logged in!" Hope this helps! === I would have rewritten the above code...-without using outdated line numbers/being combined together with goto statements-...as being the following... '*** set username/password... userName$="abc" passWord$="123" '*** get username/password DO CLS PRINT "Log in..." PRINT INPUT "Username: ", guessUserName$ INPUT "Password: ", guessPassWord$ LOOP UNTIL guessUserName$=userName$ AND guessPassWord$=passWord$ '*** print welcome screen... CLS PRINT TIME$ + " " + DATE$ PRINT PRINT "Congratulations, "; userName$; ", you have successfully logged in!"
In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.
' '*** PROGRAM: Collecting student data: names/marks. ' '*** Create 2 array variables to store each students name/marks... DIM students$(10), marks$(10) '*** SCREEN ONE/Collect the data... CLS '...(CL)ear the Output (S)creen '*** print heading... PRINT "PROGRAM: Collecting each student names/marks..." PRINT '*** A FOR/NEXT loop is used to collect each individual students data... FOR eachStudentNo% = 1 TO 10 '*** Get each students names/marks 'by typing these values in from the keyboard.... PRINT eachStudentNo%; ">" INPUT " Enter student name"; students$(eachStudentNo%) INPUT "Enter student marks"; marks$(eachStudentNo%) NEXT '*** SCREEN TWO: Output the collected data... CLS '...(CL)ear the Output (S)creen '*** Print headings... PRINT "Student No.", "Student Name", "Student Marks" PRINT '*** FOR/NEXT loop is used to print out the 2 array student 'name/marks' values... FOR eachStudentNo% = 1 TO 10 '*** print out each students 'number/name/mark' values... PRINT eachStudentNo%, PRINT students$(eachStudentNo%), PRINT marks$(eachStudentNo%) NEXT END '...END of program/halt program code execution
PRINT "What is your name ?" INPUT NAM$ CLS FOR N = 1 TO 10 PRINT NAM$ NEXT N
To program a PCR-T465 cash register to print the store name, first access the programming mode by pressing the "Mode" key and then entering the password if required. Navigate to the store settings or "Program" section, select the option for "Store Name," and then input the desired name using the numeric keypad. Finally, save the changes and exit the programming mode to ensure the store name is printed on receipts.
Yes. I can write a python program that asks for your name and then prints "Hi, name, good to meet you." by writing the following program.#!/usr/bin/pythonname = input("What is your name? ")print("Hi", name + "," , "good to meet you.")If I change the third line toprint("Hi", name + ",", "good to meet you. Your name is", len(name), "letters long.")It will say "Hi name, good to meet you. Your name is xletters long.", thus making it a different program.
you need strings to print any character(your name) this is not possible useing array:D
DIM grade(6), lowGrade(5), testName$(6), seq$(6) seq$(1) = "first " seq$(2) = "second" seq$(3) = "third " seq$(4) = "fourth" seq$(5) = "fifth " grLetter$ = "ABCD" begin: COLOR 7, 0 CLS PRINT "Test averaging program" PRINT "======================" PRINT PRINT "Lets enter some basic info before we get started .." PRINT FOR ix% = 1 TO 4 PRINT "enter a number (1-100) that you consider to be the lowest "; MID$(grLetter$, ix%, 1); INPUT lowGrade(ix%) PRINT STRING$(78, "-") NEXT ix% enterTests: COLOR 7, 0 CLS LINE INPUT "Enter student name or / to end program: "; name$ IF name$ = "/" THEN CLS END END IF LINE INPUT "Enter student age : "; age$ age% = VAL(age$) PRINT STRING$(78, "=") FOR ix% = 1 TO 5 PRINT "Enter the subject name for the "; seq$(ix%); " test: "; LINE INPUT testName$(ix%) LINE INPUT "Enter the grade for this test (1-100): "; grade$ grade(ix%) = VAL(grade$) PRINT STRING$(78, "-") NEXT ix% CLS displayReport: COLOR 7, 0 CLS GOSUB computeAverage PRINT "Test Average Report for "; name$ PRINT PRINT "Age is "; age$ IF (age% >= 25) = 0 THEN COLOR 6, 0 PRINT " ** Student is underage **" END IF COLOR 7, 0 stuGrade = average GOSUB determineAthruF PRINT "Test average is"; PRINT USING "###.##"; average PRINT "This is a grade of "; grade$ IF grade$ = "F" THEN COLOR 4, 0 PRINT "** Student did not pass **" END IF COLOR 7, 0 PRINT PRINT "Test Summary (those in "; COLOR 4, 0 PRINT "red"; COLOR 7, 0 PRINT " are failing)" PRINT FOR ix% = 1 TO 5 COLOR 7, 0 stuGrade = grade(ix%) GOSUB determineAthruF rptName$ = SPACE$(25) MID$(rptName$, 1) = testName$(ix%) IF grade$ = "F" THEN COLOR 4, 0 END IF PRINT rptName$, grade$, PRINT USING "###.##"; stuGrade NEXT ix% COLOR 7, 0 PRINT LINE INPUT "Do you wish to average another student (Y/N) "; yn$ yn$ = UCASE$(yn$) IF yn$ = "Y" THEN GOTO enterTests END IF END computeAverage: total = 0 FOR ix% = 1 TO 5 total = total + grade(ix%) NEXT ix% average = total / 5 RETURN determineAthruF: IF stuGrade >= lowGrade(4) THEN grade$ = "D" IF stuGrade >= lowGrade(3) THEN grade$ = "C" IF stuGrade >= lowGrade(2) THEN grade$ = "B" IF stuGrade >= lowGrade(1) THEN grade$ = "A" END IF END IF END IF ELSE grade$ = "F" END IF RETURN
cls input "enter a name"; a$ b=1 while b <=1 print a$ b = b+1 wend end
Example: start ask the name for each word . print first letter stop
I was able to create a login program in qbasic with this simple code: cls 1 input "Username: " , username$ if username$ <> "Define what you want your name to be here (use the quotes)" then goto 1 else input "Password: " , password$ if password$ <> "Again define using quotes" then goto 1 else print "You have successfully logged in!" Hope this helps! === I would have rewritten the above code...-without using outdated line numbers/being combined together with goto statements-...as being the following... '*** set username/password... userName$="abc" passWord$="123" '*** get username/password DO CLS PRINT "Log in..." PRINT INPUT "Username: ", guessUserName$ INPUT "Password: ", guessPassWord$ LOOP UNTIL guessUserName$=userName$ AND guessPassWord$=passWord$ '*** print welcome screen... CLS PRINT TIME$ + " " + DATE$ PRINT PRINT "Congratulations, "; userName$; ", you have successfully logged in!"
/*to print your namr*/ /*by girish kumar raghuvanshi*/ #include<stdio.h> #include<conio.h> void main() { printf("print ur name"); puts("girish"); getch(); }
There are many ways you can make a flowchart that will print and display a name 10 times. One example, will make you work with array, but you would input arr[1] for Sunday and arr[7] for Saturday.