C64S tape image fileBASIC BASIC ÝCONTENTS ąÝ LESSON #1-1 ĘŽLESSON #1-2 ČX%LESSON #2-1  1LESSON #2-2 ÎŻ<LESSON #3-1 É}HLESSON #3-2 G FTLESSON #3-3 ʍ[LESSON #4-1 ›WgLESSON #4-2 ŽňrLESSON #4-3 § ~LESSON #4-4 œGŠLESSON #5-1 }ă•LESSON #5-2 ‰1020<™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";YI˛1¤38:™""C$"";:‚:™C$tI˛1¤23:™"‘"C$"";:‚:Ž†I˛1¤3000:‚:Ž˜ ™"“´ ™Ł27) "Í Î"Ë™Ł27)" ’  "♣27)" ’  "ů(™Ł27)" ’  "2™Ł27)" ’  "%<™Ł27)"Î Í"8F™Ł28)"ŁŁŁŁŁŁ"UP™Ł23)"ŠŁŁŁŁŁPETŁŁŁŁŁŁß"rZ™Ł23)" ŚŚŚ ¤¤¤¤¤¤ ¤¤ "d™Ł23)" ŚŚŚ§żżżżżżĽ§żżĽ"Žn™Ł23)" ’¨¨¨§żżżżżżĽ§żżĽ"Ëx™Ł23)" ŁŁŁŁŁŁ ŁŁ "ׂ7:‰190űŒ™""Ł9)" ‘ ‘ ‘ ‘ΑΑΖ‰370ž™"#ș" Š "8ҙ"  ’  ’Š"Lܙ"  ’  ß"]ć™" ß ’"nđ™"E C Eú™" C O R"™" OMMODO"œ™" M"Š™" O"ś"™" D"Ă,™" O"Đ6™" R"á@™" ECOMM"ďJ™" C"ţT™" O"^™" M"h7:‰140;r™""Ł12)"ÎŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁÍ"[|™Ł11)"Î HI THERE PET! Í"†™Ł11) "Í Î"Ś™Ł11) " ͤ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤Î"­š7Ýô™"";:I˛1¤7:™Ł11)" ":‚í&I˛1¤1000:‚X™"":I˛1¤12:™"";:‚"b™Ł26)"ѝŃŃ‘ѝ‘ѝ‘Ń"1dI˛1¤200:‚=˛™"_ź™Ł14)" ÎŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁÍ‚Ć™Ł14)" Î 2 INPUT A$ ͲĐ™Ł14)" Î4IFA$<>"Ç(34)"BASIC"Ç(34)"THENSTOPÍÖÚ™Ł14)" Í 6 GO TO 2 Îů䙣14)" ͤ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤Î 7:7; ™"";:I˛1¤6:™Ł14)" ":‚T "™"":I˛1¤12:™"";:‚p $™Ł26)"   ‘ ‘ ‘ "€ *I˛1¤1000:‚¤ 4™""Ł9)" ‘ ‘ ‘ ‘ΑΑÎÔ H™""Ł3)" ÎŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁÍ R™ Ł3)"Î I GUESS I'LL HAVE TO LEARN BASIC’ Í5 \™Ł3)"Í IF I WANT TO TALK TO MY PET Îb f™" ͤ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤Îi 7‚ „™"":I˛1¤12:™"";:‚ Ž™Ł29);˘ ˜I˛1¤20:™"YEP!";° J˛1¤50:‚É ˘™"YEP!’";:‚Ű č7:™"“":‰1028 üC$˛"×":3:™""Ł5)"’B E G I N N I N G B A S I C< ţ™""Ł9)"F O R T H E P E T} ˙™Ł17)"Š ß":™Ł17)" ’  ’Š":™Ł17)" ’  ß":™Ł17)"ß ’Šł I˛1¤5:™:‚:™"C.77 RONALD LODEWYCK & RALPH JAMES˝ 7:‰9ë ™"“NOTE:’ THE COMPUTER WILL PAUSE ™"OCCASIONALLY, ALLOWING YOU TIME; ™"TO READ THE TEXT.d ™Ł8)"WHENEVER THIS OCCURS, YOU MUST"¨ ™Ł8)"PRESS THE SPACE BAR TO PROCEED":™Ł8)"LIKE RIGHT NOW!!ź ĄA$:‹A$˛""§1035ă ™"“"Ł11)"TABLE OF CONTENTS":3000 ™"LESSON TOPICS":™"ŁŁŁŁŁŁ ŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁF ™" 1 INTRODUCTION, LINE NUMBERSP 3000y ™" 2 VARIABLES, INPUT, LIST, RUNƒ 3000˘ ™" 3 PRINT, END":3000Ě ™" 4 NUMBERS,STRINGS,EXPRESSIONS,!™" HIERARCHY, LET, HOMEWORK (H.W.)":3000."™" 5 H.W., IFÎTHEN, GOTO, H.W.":3000Z$™" 6 H.W., READÎDATA, ARRAYS":3000†&™" 7 LOOPING, FORÎNEXT, H.W.":3000š(™" 8 H.W., GOSUB, ON¤GOTO, ON¤GOSUB":3000í*™" 9 SAVING PROGRAMS,SAMPLE PROGRAMS":3000,™"10-15 SIX SAMPLE PROGRAMS":2990 ĆC$˛"×"7Ѝ3:™"":I˛1¤5:™:‚JŇ‹¸(0)ą999§2010…Ô™"PRESS SHIFT-RUN TO LOAD LESSON 1":I˛1¤16:™:‚:€¤Ú™"LOADING-PLEASE WAITśîI˛1¤16:™:‚:“ĘŽ ĄA$:‹A$˛""§2990Ҹ ™:ŽÚ LL$Z$˛Ç(34)EQ$˛"‘ ‘‘":‰100v™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";“I˛1¤38:™""C$"";:‚:™C$ŽI˛1¤23:™"‘"C$"";:‚:ŽżĄA$:‹A$˛""§6Ç™:Ž2™"IN THIS AND SUBSEQUENT LESSONS THE":™"COMPUTER WILL ASK YOU QUESTIONS.":™e4™"THE COMPUTER WILL PRINT A":™:™"?":™:™"AND WAIT FOR YOU TO ENTER YOUR ";š6™"ANSWER.":™:™"AFTER YOU TYPE IN YOUR ANSWER YOUé8™"MUST PRESS THE RETURN KEY.":™:™"IF YOU MAKE THE MISTAKE OF PRESSING THE39™"RETURN KEY WITHOUT ENTERING ANY DATA,":™"THE COMPUTER WILL STOP.":™r<™"TO CONTINUE FROM THE SAME PLACE YOU":™"TYPE":™:™"CONT":™›>™"AND PRESS THE RETURN KEY.":6:‰103ŮdC$˛"Ń":3:™""Ł15)"LESSON 1":™Ł12)"1. INTRODUCTIONf™Ł12)"2. LINE NUMBERS":6:™"“":‰50g™"“"Ł14)"INTRODUCTION":™Kh™"BASIC IS A SIMPLE LANGUAGE WHICH ALLOWSzj™"US TO COMMUNICATE WITH THE COMPUTER.":7Śl™"LEARNING BASIC’ IS LIKE LEARNING ANYín™"OTHER LANGUAGE - YOU MUST LEARN THE":™"VOCABULARY AND RULES.":7p™"THIS INTRODUCTORY COURSE IS DESIGNED\r™"TO TEACH YOU THIS.":7:™"HOWEVER, LIKE LEARNING ANY LANGUAGE,˘t™"IT WILL BE THROUGH PRACTICE THAT YOU":™"WILL BECOME PROFICIENT.Đv6:™"“WE COMMUNICATE WITH THE COMPUTER BY x™"CREATING A PROGRAM’.":7:™"CREATING A PROGRAM CONSISTS OF TWOJ z™"PHASES:":™:™"1. WRITING A LIST OF INSTRUCTIONS‹ |™" , AND":7:™"2. HAVING THE COMPUTER EXECUTEŇ ~™" THE INSTRUCTIONS.":7:™"HERE'S AN EXAMPLE OF A PROGRAM: €6:™"“10 PRINT"Z$"ENTER YOUR AGE IN YEARS"Z$:™"20 INPUT AD ‚™"30 PRINT"Z$"YOU ARE"Z$" 365*A "Z$"DAYS OLD"Z$ƒ „I˛1¤39:™"Ă";:‚:7:™"THIS PROGRAM WILL COMPUTE YOUR AGE INĆ †™"DAYS (APPROXIMATELY).":7:™"LET'S SEE WHAT HAPPENS WHEN THIS ˆ™"PROGRAM IS RUN -":™:™"BE SURE TO ENTER YOUR AGE WHEN ASKED, ‰™"AND PRESS THE RETURN KEY":7a ŠI˛1¤39:™"Ć";:‚:7:™"ENTER YOUR AGE IN YEARS":…A— Œ™"YOU ARE "365ŹA" DAYS OLD":7:I˛1¤39:™"Ă";:‚:7Ţ Ž™"WOULD YOU LIKE TO SEE THE PROGRAM RUN":™"AGAIN (YES OR NO)";:…A$ř ‹A$˛"YES"°A$˛"NO"§145 ™Q$:‰142 ‘‹A$łą"YES"§160` ’™"":I˛1¤9:™" ":‚y ”™"":‰138Š  ™"“HERE'S ANOTHER EXAMPLE OF A PROGRAM:":7ĺ ˘™"10 PRINT"Z$"ENTER DEGREES FAHRENHEIT"Z$:™"20 INPUT F" ¤™"30 PRINT"Z$"DEGREES CELSIUS = "Z$"5*(F-32)/9":7V ŚI˛1¤39:™"¸";:‚:7:™"LET'S SEE WHAT HAPPENS WHEN THIS ¨™"PROGRAM IS RUN -":™"BE SURE TO ENTER A TEMPERATUREĚ Ş™"WHEN ASKED ":7:I˛1¤39:™"¸";:‚:™Ź™"ENTER DEGREES FAHRENHEIT":…F:™"DEGREES CELSIUS ="5Ź(FŤ32)­9:7(­I˛1¤39:™"¸";:‚:7UŽ™"WOULD YOU LIKE TO SEE THIS PROGRAM RUN‰Ż™"AGAIN (YES OR NO)";:…A$:‹A$˛"YES"°A$˛"NO"§177–°™Q$:‰174Šą‹A$łą"YES"§190ň˛™"":I˛1¤7:™" ":‚ ´™"":‰172>žC$˛"Ń":3:™""Ł9)"END OF LESSON 1 PART 1mŔV$˛"":™""Ł9);:‹¸(0)ą999§194ˆÁ™"PRESS SHIFT-RUN"V$:€¨™"LOADING, PLEASE WAIT"V$:“Ž^“ ‰100ĄA$:‹A$˛""§7#™:Žb I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";:I˛1¤38:™""C$"";ƒ ‚:™C$:I˛1¤23:™"‘"C$"";:‚:ŽĄd™"“"Ł12)"LINE NUMBERS":8Ę„™"A BASIC PROGRAM CONSISTS OF A LISTöŹ™"OF STATEMENTS PERFORMED ONE AT A TIME&ś™"IN SEQUENCE ACCORDING TO LINE NUMBER.":8YĘ™"EVERY STATEMENT MUST HAVE A LINE NUMBER.":8†Ţ™"AS YOU WRITE A STATEMENT, ITS POSITIONŹč™"IN THE PROGRAM IS AUTOMATICALLYŐň™"DETERMINED BY ITS LINE NUMBER.":8űü™"TO ILLUSTRATE THE IMPORTANCE OF$™"LINE NUMBERS, LET US RETURN TO THE@™"PREVIOUS PROGRAM.":7t™"“10 PRINT"Ç(34)"ENTER YOUR AGE IN YEARS"Ç(34)…$™"20 INPUT AÇ.™"30 PRINT"Ç(34)"YOU ARE "Ç(34)" 365*A "Ç(34)" DAYS OLD"Ç(34)á0™:I˛1¤39:™"Ł";:‚I:8B™"SUPPOSE WE WISH TO PRINT OUT THE/L™"AGE IN MONTHS AS WELL AS DAYS":™^V8:™"NOW ENTERING THE FOLLOWING STATEMENT:ž`™:™"35 PRINT"Ç(34)"YOU ARE "Ç(34)" 12*A "Ç(34)" MONTHS OLD"Ďj™:™"AUTOMATICALLY INSERTS THIS TO YIELD:":8čoI˛1¤38:™"¤";:‚I:™:™t™"10 PRINT"Ç(34)"ENTER YOUR AGE IN YEARS"Ç(34),~™"20 INPUT Anˆ™"30 PRINT"Ç(34)"YOU ARE "Ç(34)" 365*A "Ç(34)" DAYS OLD"Ç(34)ą’™"35 PRINT"Ç(34)"YOU ARE "Ç(34)" 12*A "Ç(34)" MONTHS OLD"Ç(34)Úd7:™"“LETS HAVE THE COMPUTER RUN THE n™"NEW PROGRAM JUST TO VERIFY WHAT x™"IT NOW DOES@ z™"ĎŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁĐm |™"ĽBE SURE TO ANSWER THE QUESTION"Ł38)"§Ÿ ~™"̤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ş":8Ă –™:™"ENTER YOUR AGE IN YEARS":…Aâ  ™"YOU ARE "365ŹA" DAYS OLD Ş™"YOU ARE "12ŹA" MONTHS OLD":™:72 ú™"“YOU MAY HAVE WONDERED WHY THE LINE] ™"NUMBERS IN THE ORIGINAL PROGRAM WERE{ ™"IN MULTIPLES OF 10.":8˘ ™"THIS ALLOWS FOR INSERTION OF NEWß "™"INSTRUCTIONS IF WE DECIDE TO MODIFY":™"THE PROGRAM":8 6™"LINE NUMBERS CAN BE ANY NUMBER FROM":™"1 TO 63999":8F J™"LINE NUMBERS ALSO ALLOW US TO CHANGEt T™"-OR DELETE- EXISITING INSTRUCTIONS.":7Ą h™"“SUPPOSE WE WANT TO CHANGE LINE 145 IN r™"THE FOLLOWING PROGRAM:":8𠆙"135 PRINT"Ç(34)"INPUT TWO NUMBERS"Ç(34) ™"140 INPUT A,B7 š™"145 PRINT"Ç(34)"THE PRODUCT IS "Ç(34)"A+B":™Q ¤I˛1¤38:™"Ł";:‚I:™:8l Ž™"WE WOULD NOW ENTER: ™"145 PRINT"Ç(34)"THE SUM IS "Ç(34)"A+B":8 Ö™"THE MODIFIED PROGRAM WOULD NOWŘ ŕ™"CONSIST OF:":8ń ĺI˛1¤38:™"¤";:‚I:™:™ ę™"135 PRINT"Ç(34)"INPUT TWO NUMBERS"Ç(34)3 ô™"140 INPUT A,Bc ţ™"145 PRINT"Ç(34)"THE SUM IS "Ç(34)"A+B":8“ ™"(NOTE HOW LINE 145 HAS BEEN CHANGED)";:7É ™"“SIMILARLY, AN INSTRUCTION CAN BE":™"DELETED ";đ ™"BY ENTERING JUST THE LINE NUMBER &™"(AND NOTHING ELSE)":8]:™"TO DELETE ALL LINES IN A PROGRAM":™"(I.E. CLEAR MEMORY FOR A NEW PROGRAM)‡D8:™"ENTER THE COMMAND":8:™"NEW":8ĽN™"Ď";:I˛1¤37:™"Ł";:‚:™"ĐáX™"Ľ"Ł38)"§":™"Ľ"Ł38)"§":™"Ě";:I˛1¤37:™"¤";:‚:™"ş‘‘‘‘";b™"NOTE: NEW’ IS A COMMAND AND IS NOT:l™"PRECEEDED BY A LINE NUMBER":7OŹC$˛"Ř":™"“":10pĘ™""Ł12)"END OF LESSON 1šĎ™""Ł4)"TO PROCEED, LOAD LESSON#2-1ˇŇ™"(PRESS SHIFT-RUN)ÇԁI˛1¤10:™:‚d:Q$˛"‘ ‘‘":‰100k™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";ˆI˛1¤38:™""C$"";:‚:™C$ŁI˛1¤23:™"‘"C$"";:‚:Ž´ĄA$:‹A$˛""§6ź™:ŽňdC$˛"Á":3:™""Ł15)"LESSON 2":™Ł12)"1. LIST+n™Ł12)"2. RUN":™Ł12)"3. VARIABLES":™Ł12)"4. INPUT":65x‰2682Më™"“"Ł15)"VARIABLES|đ™"LET US RECALL THE PROGRAM FROM LESSON 1:´™"10 PRINT"Ç(34)"ENTER YOUR AGE"Ç(34):™"20 INPUT Aö™"30 PRINT"Ç(34)"YOU ARE "Ç(34)" 365*A "Ç(34)" DAYS OLD"Ç(34)""™"THE LETTER A’ IS CALLED A VARIABLEjJ™"A VARIABLE ALLOWS US TO STORE DATA":™"AND REFER BACK TO IT LATERľ^™"THE VARIABLE NAME, FOR EXAMPLE A,":™"IS MERELY A LABEL FOR A STORAGEŐr™"LOCATION IN THE COMPUTER†™"LINE NUMBER 20 ALLOWED US TO STORE":™"A NUMBER (IN LOCATION A)g¤™"LINE 30 ALLOWED US TO USE THE NUMBER":™"STORED IN LOCATION A FOR A ";Ž™"CALCULATION":6:™"“ŇĚC˛CŞ1:™"A VARIABLE MUST BE A LETTER -OR-":™"A LETTER FOLLOWED BY A DIGIT ORřÖ™"ANOTHER LETTER":™"FOR EXAMPLE:0ŕ™Ł6)"A":™Ł6)"TS":™Ł6)"R4":™Ł6)"Q":™Ł6)"R2":™Ł6)"D2Z:™"ARE ALL ACCEPTABLE VARIABLE NAMESœN™"WHEREAS:":™Ł6)"3Z":™Ł6)"3CPO":™Ł6)"5":™Ł6)"2.2":™"ARE NOT׊6:™"“":™Ł6)"1. HH":™Ł6)"2. X5":™Ł6)"3. 7F":™Ł6)"4. Y& Ć™"WHICH OF THE ABOVE IS NOT’ AN":™"ACCEPTABLE VARIABLE NAME(1,2,3 OR 4)";E ä…A$:‘Ĺ(A$)‰750,750,820,750R é™Q$:‰710† î™"NO, THIS IS PERFECTLY ACCEPTABLE.":‹Cą2§822ž ř™"LET'S GO OVER VARIABLE NAMES AGAIN.":6:™"“":‰460 4™:I˛1¤20:™"THAT'S RIGHT!THAT'S RIGHT!’";:‚6 6™"7F IS NOT AN ACCEPTABLE VARIABLE NAMEk 8™"SINCE THE FIRST CHARACTER MUST BE":™"A LETTERœ :™"NOW LET'S SEE HOW WE USE VARIABLES.":‰3000Ö z ™"“"Ł17)"LIST":™"FREQUENTLY, WHEN A PROGRAM IS BEING | ™"CREATED, DELETIONS AND CORRECTIONS ARE":™"NECESSARY.b ~ ™"TO OBTAIN A LISTING OF THE CURRENT":™"PROGRAM, THE LIST’ COMMAND IS USED˜ € ™"THE USER SIMPLY ENTERS THE WORD:":™"":™"LISTË ‚ ™"AND A LISTING OF THE PROGRAM WILL":™"RESULT.ë „ ™"Ď";:I˛1¤36:™"Ł";:‚:™"Đ"; † ™"§§ş";:I˛1¤36:™"¤";:‚:™"Ě";& ˆ ™"‘Ľ‘Ľ";j Š ™"NOTE: LIST’ IS NOT PRECEEDED BY":™"Ľ A LINE NUMBER.":6š Œ ™"“IF A PARTIAL LISTING OF THE PROGRAM":™"IS DESIRED, ONE OF THE FOLLOWINGř Ž ™"OPTIONS MAY BE USED:":™"LIST-L"Ł12)"LISTS UP TO LINE L  ™"LIST L-M"Ł12)"LISTS LINES L TO MI ’ ™"LIST L-"Ł12)"LISTS LINES L TO ENDl ” ™"LIST L"Ł12)"LISTS LINE L":6§ – ™"“"Ł18)"RUN":™"AFTER A PROGRAM HAS BEEN ENTERED INTOň ˜ ™"THE COMPUTER, AND ALL KNOWN ERRORS":™"CORRECTED, WE ARE READY TO RUN3š ™"(I.E. EXECUTE) IT.":™"THE COMMAND THAT TELLS THE COMPUTERQœ ™"TO DO THIS IS:":™"RUNqž ™"Ď";:I˛1¤36:™"Ł";:‚:™"Đ";  ™"§§ş";:I˛1¤36:™"¤";:‚:™"Ě";Ź˘ ™"‘Ľ‘Ľ";ď¤ ™"NOTE: RUN ’IS NOT PRECEEDED":™"Ľ BY A LINE NUMBER.":6řŞ ‰235 ¸ 6:C$˛"Á":3;˝ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMb ™""Ł8)"END OF LESSON 2 PART 1—Ö V$˛"":™"";:‹¸(0)ą999§3032˛× ™"PRESS SHIFT-RUN"V$:€ĹŘ ™"LOADING"V$:“$9Q$˛"‘ ‘":‰855j™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";‡I˛1¤38:™""C$"";:‚:™C$˘I˛1¤23:™"‘"C$"";:‚:ŽłĄA$:‹A$˛""§6ť™:ŽŘW™"“"Ł12)"INPUT STATEMENTY7:™"ONE USE OF A VARIABLE IS TO ALLOW0f™"US TO ENTER DATA INTO THE COMPUTER":7Zz™"THE INPUT STATEMENT ALLOWS THE USER™"TO ENTER DATA INTO A SPECIFIEDÁ„™"VARIABLE (OR VARIABLES) EACH TIME":™"THE PROGRAM IS RUN":7폙"THE FORMAT OF THE INPUT STATEMENT IS:ą™"LINE NUMBER’ INPUT LIST OF VARIABLES’%Ŕ6\č™"“FOR EXAMPLE:20 INPUT N1,A,BB":™Ł12)"35 INPUT X™Ł12)"15 INPUT Y4,I":™"ARE ALL ACCEPTABLE":7Ć.™"WHEREAS:"Ł12)"10 INPUT,M":™Ł12)"25 A,B,C INPUT" L™Ł12)"INPUT F":™Ł12)"40 INPUT R S T":™"ARE UNACCEPTABLE BECAUSE:E`7:™"THERE IS AN UNNECESSARY COMMA IN":™"LINE 10":7{d™"THE VARIABLES PRECEDE INPUT’ IN":™"LINE 25":7Źf™"THE LINE NUMBER IS MISSING IN INPUT F":7ďh™"THE VARIABLES ARE NOT SEPARATED BY":™"COMMAS IN LINE 40";:61t™"“"Ł12)"15 INPUT A0,B":™Ł12)"33 INPUT X Y Z":™Ł12)"12 INPUTQpœ™Ł12)"8 INPUT Q":™"WHICH OF THE ABOVE IS AN UNACCEPTABLEŞ°™"INPUT STATEMENT (15,33,12 OR 8)";:…A$:‹A$˛"33"§2310źś‹A$˛"12"§2280Ő¸‹A$˛"15"°A$˛"8"§2240ăş™Q$:‰1200, Ŕ™"THIS INPUT STATEMENT IS ACCEPTABLE":™"BETTER TRY AGAIN!":6:‰11402 č™~ í™"NO, LINE 12 IS CORRECT BECAUSE A":™"SPACE IS NOT REQUIRED BETWEEN THEÇ ü™"WORD INPUT AND THE FIRST VARIABLE":™"NAME":™"TRY AGAIN!":6:‰1140  ™"":I˛1¤9:™"RIGHT ON!!RIGHT ON !!’";:‚:7> $ ™"VARIABLES MUST BE SEPARATED BY COMMAS":6l ) ™"“WHEN AN INPUT STATEMENT IS ENCOUNTEREDľ B ™"DURING PROGRAM EXECUTION, A QUESTION":™"MARK (?) IS PRINTED ON THEç V ™"TERMINAL, INDICATING A REQUEST FOR DATA":7 t ™"THE COMPUTER WILL WAIT UNTIL THE USER< ~ ™"ENTERS THE APPROPRIATE DATA BEFOREh ˆ ™"RESUMING EXECUTION OF THE PROGRAM":7’ œ ™"THE COMPUTER EXPECTS TO RECEIVE ONEÚ Ś ™"DATA ENTRY FOR EACH VARIABLE LISTED IN":™"THE INPUT STATEMENT":6 Ä ™"“THUS THE STATEMENT:":™Ł5)"15 INPUT X,Y1,ZZW ⠙"REQUIRES THE USER TO ENTER THREE":™"NUMBERS SEPARATED BY COMMAS INš ö ™"RESPONSE TO THE ?":7:™"FOR EXAMPLE, DURING EXECUTION OF THEŰ  ™"ABOVE STATEMENT, THE USER MIGHT ENTER:":™"10, 6.25, 0.011 ( ™"WHICH CAUSES THE NUMBERS":™"10, 6.25 AND 0.011: 2 ™"TO BE STORED IN X, Y1 AND ZZ":6o < ™"“IF HOWEVER, IN RESPONSE TO THE":™"STATEMENT:ˇ F ™" 15 INPUT X,Y1,ZZ":7:™"THE USER ENTERS FEWER THAN 3 NUMBERS,ý P ™"THE COMPUTER WILL RESPOND WITH ??":™"INDICATING MORE DATA MUST=Z ™"BE ENTERED.":7:™"FOR EXAMPLE, IF ONLY THE NUMBER 10 WERE|d ™"ENTERED:":™"? 10":7:™"THE COMPUTER WOULD RESPOND WITH:­n ™"??":7:™"AT THIS POINT THE USER MUST ENTERÚx ™"MORE DATA:":™"? 10":™"?? 21, 35.2":6é¸ C$˛"Á":3  ™""Ł12)"END OF LESSON 2EŘ ™"LOAD LESSON#3-1 WHEN READY":™"TO PROCEEDUÚ I˛1¤12:™:‚$S PART 2 INTO MEMORYĂÚ I˛1¤12:™:‚Éŕ “Ňˆ...$6Q$˛"‘ ‘‘‘":‰10g™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";„I˛1¤38:™""C$"";:‚:™C$ŸI˛1¤23:™"‘"C$"";:‚:Ž°ĄA$:‹A$˛""§6¸™:ŽĹ Z$˛Ç(34)üdC$˛"#":3:™""Ł15)"LESSON 3":™Ł12)"1. PRINTn™Ł12)"2. SPACING"0x™Ł12)"3. TAB FUNCTION":6Më™"“"Ł18)"PRINT":7:‰2900Œ, C‘SIDER THE FOLLOWING ™ STATEMENTS:":PRINT"5 ™ A,"Z$"CATS"–R ‰9002ťT ™"THE PRINT STATEMENT IS USED TOů¸ ™"TRANSMIT DATA FROM THE COMPUTER TO THE":™"SCREEN.":™:7)Ö ™"THE FORMAT OF THE PRINT STATEMENT IS:":™`ŕ ™" LINE NUMBER’ PRINT OUTPUT LIST’":™:6:™"“ˆĺ ™"THE OUTPUT LIST MAY CONTAIN :":7Čę ™"NUMBERS (5.87 .23 ETC)":7:™"VARIABLES (A D2 TS ETC)":7ď ™"EXPRESSIONS (A+D/TS ETC)":7:™"STRINGS ("Z$"NO"Z$" "Z$"YES"Z$" ETC)=ô 7:™"STRING VARIABLES (A$ S$ ETC)":7wţ ™"(NOTE: STRING VARIABLES ARE DISCUSSED":™"LATER)":7Ŕ ™"HERE ARE SOME EXAMPLES OF PRINT":™"STATEMENTS:":6:™"“12 PRINT A,CŰ ™"13 PRINT"Z$"HELLO"Z$& ™"5 PRINT"Z$"YOUR AGE IS "Z$" 365*A "Z$" DAYS"Z$80 7:™"WHEN STATEMENT 12 IS EXECUTED,}N ™"THE VALUES STORED IN VARIABLES A AND":™"C WILL BE PRINTED.":7şl ™"IN STATEMENT 13 THE WORD HELLO WILL":™"BE PRINTED.":7 € ™"IN GENERAL, ANYTHING ENCLOSED IN":™"QUOTATION MARKS WILL BE PRINTEDK ” ™"EXACTLY AS IT APPEARS.":7:™"IN LINE 5, IF THE VALUE 10 HAD BEEN‡ ˛ ™"STORED IN A, THE FOLLOWING WOULD":™"BE PRINTED:":™:7Ď Ć ™"YOUR AGE IS 3650 DAYS":7:™"IN GENERAL, ANY ARITHMETIC EXPRESSIONű ä ™"CAN BE USED IN A PRINT STATEMENT.":6 î ™"“WHICH OF THE FOLLOWING:R  ™"505 PRINT C":™"723 PRINT YOUR CASH BALANCE IS $C_ % Z$˛Ç(34) * ™"18 PRINT"Z$" YOUR CASH BALANCE IS $"Z$"CĘ 4 ™"442 PRINT"Z$"$"Z$" C+D "Z$" IS YOUR CASH BALANCE"Z$ > ™"IS NOT’ AN ACCEPTABLE PRINT STATEMENT":™"(505, 723, 18 OR 442)"; H …A$. \ ‹A$˛"723"§3750A f ‹A$˛"442"§3630S p ‹A$˛"18"§3520f r ‹A$˛"505"§3450t u ™Q$:‰3390Ä z ™"THERE IS NOTHING WRONG WITH LINE":™"505. IF THE VALUE 102.5 IS STORED IN Ž ™"C, THE STATEMENT WOULD INSTRUCT THE":™"COMPUTER TO PRINT/ ˘ ™Ł5)"102.5":7:™"TRY AGAIN!":6:‰3310^ Ŕ ™"LINE 18 IS PERFECTLY ACCEPTABLE. IF THE… Ę ™"VALUE 102.55 IS STORED IN C, THEż Ô ™"STATEMENT WOULD INSTRUCT THE COMPUTER":™"TO PRINT:ţ Ţ ™"YOUR CASH BALANCE IS $102.55":7:™"TRY AGAIN!":6:‰3310( .™"NOTHING WRONG HERE! IF THE VALUESu 8™"100 AND 10 WERE STORED IN C AND D":™"RESPECTIVELY, THE STATEMENT WOULD˝ B™"INSTRUCT THE COMPUTER TO PRINT:":™"$110 IS YOUR CASH BALANCE":7 j™"THE ARITHMETIC EXPRESSION C+D IS":™"COMPUTED AND THE FINAL RESULT (110)9t™"IS PRINTED.":7:™"TRY AGAIN!":6:‰3310uŚ™"VERY GOOD! SOME OF THOSE WERE NOT SO":™"OBVIOUS.":7Ŕ¨™"LINE 723 IS NOT ACCEPTABLE SINCE THE":™"QUOTATION MARKS ARE MISSING.ë(# .)# .1*#6:C$˛"#":3:+#PPPn2#™""Ł8)"END OF LESSON 3 PART 1":™Ł8);3#V$˛"":‹¸(0)ą999§9015Ť4#™"PRESS SHIFT-RUN"V$:€Ë7#™"LOADING, PLEASE WAIT"V$:“$CZ$˛Ç(34):Q$˛"‘‘ ‘‘":‰240t™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";‘I˛1¤38:™""C$"";:‚:™C$ŹI˛1¤23:™"‘"C$"";:‚:Ž˝ĄA$:‹A$˛""§6Ĺ™:Žđ™"“"Ł18)"SPACING":™"EITHER COMMAS(,) OR SEMICOLONS(;);ň™"CAN BE USED TO SEPARATE ITEMS IN THE":™"PRINT LIST.dô™"NUMBERS SEPARATED WITH A SEMICOLON“ö™"WILL BE PRINTED WITH ONE COLUMN SPACINGżř™"STRINGS SEPARATED BY A SEMICOLON WILLáú™"BE PRINTED WITH NO SPACING#ü™"FOR EXAMPLE:":™"4 PRINT 2.2;-4;0.75;"Z$"ABC"Z$";"Z$"DEF"Z$^ţ™"WOULD PRINT THE FOLLOWING:":™" 2.2 -4 .75 ABCDEFŤ™"NOTE THAT A COLUMN IS ALWAYS RESERVED":™"TO THE LEFT OF A NUMBER FOR AĹ™"MINUS (-) SIGN.":6™"“EACH LINE IS DIVIDED INTO FOUR":™"TEN-CHARACTER ZONES.3™"THE ZONES BEGIN IN COLUMNS 1,11,21,& 31™"WHEN A COMMA IS USED TO SEPARATE ITEMS":™"IN A PRINT LIST, THE ITEM";Ă ™" FOLLOWING":™"THE COMMA WILL BE PRINTED IN THE NEXT":™"ZONE.ő ™"FOR EXAMPLE:":™"7 PRINT 18,-12,"Z$"RON"Z$:™2™"WOULD PRINT THE FOLLOWING:":™" 18"Ł10)"-12"Ł20)"RONt™"‘123456789012345678901234567890123456789":™"^"Ł10)"^"Ł20)"^Ă™"NOTE THAT THE FIRST COLUMN ON THE LEFT":™"OF A NUMBER IS RESERVED FOR A ™"MINUS (-) SIGN.":6:™"“A SEMICOLON AS THE LAST CHARACTER OFP ™"THE PRINT LIST WILL CAUSE SUPPRESSION":™"OF THE CARRIAGE RETURN.":7 ™"THUS, THE NEXT PRINT STATEMENT WILL":™"CAUSE PRINTING ON THE SAME LINEć 7:™"FOR EXAMPLE:":™"8 PRINT "Z$"HOWDY"Z$";":™"9 PRINT "Z$"DOODY"Z$ 7:™"WILL PRINT:":™"HOWDYDOODY":6Y ™"“CONSIDER THE FOLLOWING PRINT STATEMENTS:":™"5 PRINT A,"Z$"CATS"Z$";Ÿ ™"7 PRINT"Z$" AND DOGS"Z$:7:™"IF 16 IS STORED IN THE VARIABLE A,ě "™"WHICH OF THE FOLLOWING WOULD RESULT:":™"1. ’ 16CATS":™" ’AND DOGS. $™"2. ’ 16"Ł13)"CATS AND DOGS":™"3. ’ 16CATS"Ł14)"AND DOGSK &™"(1, 2 OR 3)’";:…A$:™b (‘Ĺ(A$)‰300,338,326o *™Q$:‰294Á ,™"NO, THIS IS NOT CORRECT BECAUSE THE":™"COMMA AFTER THE VARIABLE A IN LINE 5í -™""Ł8)" ";:I˛1¤50:‚:™"A":I˛1¤50:‚ .ĄA$:‹A$˛""§301 4I˛1¤16:™:‚T 6™"CAUSES THE WORD CATS’ TO BEGIN PRINTING":™"IN COLUMN 11.":7 @™"THE SEMICOLON FOLLOWING "Z$"CATS"Z$"’Ť A™"IN THE FIRST PRINT STATEMENT CAUSESě B™""Z$" AND DOGS"Z$"’ TO BE PRINTED ON THE":™"SAME LINE.":7 D™"TRY AGAIN!":6:‰286U F™"NO, THIS IS NOT CORRECT SINCE A COMMA":™"FOLLOWING THE VARIABLE A LINE 5 H™""Ł8)" ";:I˛1¤50:‚:™"A":I˛1¤50:‚” JĄA$:‹A$˛""§328¤ KI˛1¤16:™:‚ď L™"CAUSES CATS’ TO BE PRINTED IN THE":™"SECOND TEN-CHARACTER ZONE.":7N™"ALSO, THE SEMICOLON AFTER "Z$"CATS"Z$"’NP™"IN LINE 5 RESULTS IN NO SPACING.":7:‰324}R™"ALRIIIGHT! THE COMMA CAUSES CATS’ TO BE§T™"PRINTED IN THE SECOND TEN-CHARACTERÓV™"ZONE AND THE SEMICOLON SUPPRESSES THEX™"CARRIAGE RETURN SO THAT  AND DOGS’ IS3Z™"PRINTED ON THE SAME LINE WITH NO SPACING":6B*#C$˛"#":3v2#™""Ł8)"END OF LESSON 3 PART 2":™Ł8);˜4#V$˛"":‹¸(0)ą999§9015ł5#™"PRESS SHIFT-RUN"V$:€Ć7#™"LOADING"V$:“$$C.77JAMES&LODEWYCK209-6348888]Q$˛"‘ ‘‘‘‘":‰10Ž™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";ŤI˛1¤38:™""C$"";:‚:™C$ƁI˛1¤23:™"‘"C$"";:‚:Ž×ĄA$:‹A$˛""§6ß™:Žě Z$˛Ç(34)őP‰348FZ™"IF X HAS THE VALUE 8, AND Y HAS THE":™"VALUE 25, THE FOLLOWING WOULD BE ";w\™"PRINTED":7:™Ł8)"HOWDY"Ł25)"DOODY":6:‰374ź\™"“"Ł10)"TAB FUNCTION":™:™"ANOTHER WAY TO SPACE OUTPUT IS TO USEî^™"THE TAB FUNCTION IN THE PRINT STATEMENT":7`™"EACH LINE CONTAINS 40 POSITIONS]b™"NUMBERED 0 THROUGH 39.":7:™"TAB(X) CAUSES THE COMPUTER TO MOVE TO›d™"POSITION X BEFORE PRINTING THE NEXT":™"ITEM":7:™"THUSŐf™"50 PRINT TAB(10)"Z$"HOWDY"Z$"TAB(20)"Z$"DOODY"Z$:7h™"WOULD GIVE THE FOLLOWING:":7:™Ł10)"HOWDY"Ł20)"DOODY":6?j™"“ONE OF THE NICE FEATURES OF THE TABil™"FUNCTION IS THAT IT ALLOWS NOT ONLYŁn™"FIXED SPACING, BUT VARIABLE SPACING AS":™"WELL.":7ôp™"THIS IS POSSIBLE BY USING EITHER A":™"VARIABLE OR AN EXPRESSION (DISCUSSED-r™"LATER) WITHIN THE PARENTHESES.":7:™"FOR EXAMPLE:et™"50 PRINT TAB(X)"Z$"HOWDY"Z$"TAB(Y)"Z$"DOODY"Z$:7mu‰90šv™"“IN THE STATEMENT:":™"2 PRINT TAB(5)"Z$"MICKEY"Z$"TAB(X)"Z$"MOUSE"Z$÷x7:™"IF X HAS THE VALUE 20, WHAT WOULD BE":™"PRINTED:":7 z™"1. ’ MICKEY"Ł23)"MOUSEE |™"2. ’MICKEYMOUSE":™"(1 OR 2)";:…A$U }‹A$˛"1"§392e ~‹A$˛"2"§384r ™Q$:‰380ž €™"NO, THIS WOULD BE THE RESULT WITHOUTä ‚™"ANY TAB FUNCTIONS.":7:™"ANSWER 1. IS CORRECT BECAUSE IT SPACES. „™"BEFORE PRINTING MICKEY’ AND THEN AGAIN":™"BEFORE PRINTING MOUSE’.; †6:‰9002i ˆ™"THAT'S RIGHT, THE FIRST TAB CAUSES THEˇ Š™"MICKEY’ TO START IN COLUMN 5 AND THE":™"SECOND TAB CAUSES MOUSE’ TO";ß Œ™" START":™"IN COLUMN 20.":6:‰9002î *#C$˛"#":3 2#™""Ł12)"END OF LESSON 3"D 4#™Ł3)"TO PROCEED, LOAD LESSON#4-1$7Q$˛"‘‘ ‘":‰18h™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";…I˛1¤38:™""C$"";:‚:™C$ I˛1¤23:™"‘"C$"";:‚:ŽąĄA$:‹A$˛""§6š™:ŽÓ ™"TRY AGAIN!":6:™"“Ů Žć Z$˛Ç(34)I˛1¤42:™" ";:‚:™"‘":I˛1¤UA™" ‘ ‘";:‚:™:ŽNZ$˛Ç(34)†C$˛"Ř":3:™""Ł15)"LESSON 4":™Ł12)"1.NUMBERS™Ł12)"2.STRINGS":™Ł12)"3.EXPRESSIONS":™Ł12)"4.HIERARCHYÜ(™Ł12)"5.LET STATEMENTů*™Ł12)"6.HOMEWORK PROBLEM(26:™"“":™"YOUR PET COMPUTER IS CAPABLE OF"K7™"MANIPULATING A LOT OF DATA.<™"BUT WHAT IS DATA’? IN BASIC, THERE":™"ARE TWO TYPES OF DATA:ÚA™Ł9)"NUMBERS AND STRINGS’":7:™"NUMBERS ARE CONSTANTS-EITHER WITH ORF™"WITHOUT A DECIMAL POINT.":7:™"FOR EXAMPLE:":™Ł15)"15":™Ł15);UK™"1129.92":™Ł15)"0.0012":™Ł15)"-101":™Ł15)"-1.25" P7:™"IN BASIC WE OMIT COMMAS FROM LARGE":™"NUMBERS:USE 101220 NOT’";ŻQ™" 101,220ťT6:™"“"U™"WHICH OF THE FOLLOWING IS NOT’ AN":™"ACCEPTABLE NUMBER IN BASICHZ™Ł12)"A. -10111":™Ł12)"B. .129":™Ł12)"C. $24.75":™Ł12)"D. 2001]\™"(A,B,C OR D)";t_…A$:™:‹ A$˛"B"‰110„`‹A$˛"D"‰125”a‹A$˛"C"‰135¤b‹A$˛"A"§100°c™Q$:‰92˙d™"THE NUMBER -10111 IS A.O.K. IT IS":™"NEGATIVE TEN THOUSAND ONE HUNDRED";5 f™" AND ELEVEN.(WE OMIT COMMAS IN BASIC)":9:‰85s n™"THE NUMBER .129 IS AN ACCEPTABLE DECIMAL";:™"NUMBER. ";˛ o™"OTHER ACCEPTABLE FORMS OF THE SAME":™"NUMBER WOULD BE:"Ů p™" 0.129 OR 0.1290 OR .1290 r™"(I.E. LEADING AND TRAILING ZEROES ARE IGNORED BY THE COMPUTER)+ t9:‰85k }™"THE NUMBER 2001 IS PERFECTLY ACCEPTABLE IN BASIC.":9:‰85Ś ‡™"THAT'S RIGHT! THE $’ IS NOT’ PART OF THE NUMBER.ë ‰™"IT IS A SPECIAL CHARACTER AND IS AN":™"EXAMPLE OF A STRING’."* –6:™"“"Ł15)"STRINGS":™"STRINGS CONSIST OF DATA FORMED BY"m ›™"COMBINATIONS OF LETTERS, NUMBERS, AND SPECIAL CHARACTERS."‹  ™"ALL OF THESE:":™Ł14)"$Ŕ Ľ™Ł14)"ENTER YOUR AGE IN YEARS":™Ł14)"SALARY IS $ř Ş™Ł14)"R2D2 AND C3P0":™"WOULD BE CALLED STRINGS’.! Ż™"THE PURPOSE OF STRINGS IS TO ALLOWh ą™"NON-NUMERIC INFORMATION TO BE PROCESSED IN THE COMPUTER.":6:™"“Ą ´™"WHICH OF THE FOLLOWING IS TRUE:":™"1. 12345"Ł27);ă š™"-IS A NUMBER":™"2. THE FORCE BE WITH YOU"Ł27)"-IS A STRING"$ ž™"3. 1550 W. PIONEER RD."Ł27)"-IS A STRING":™"4. 12345"Ł27);[ Ù"-IS A STRING":™"5. ALL OF THE ABOVE ARE CORRECT{ ę"(1, 2, 3, 4 OR 5)";:…A$:™š őĹ(A$)‰202,202,202,202,210§ ǙQ$:‰196ć ʙ"TRUE, BUT YOUR ANSWER IS NOT THE BEST ANSWER.":9:‰1807ҙ"THAT'S RIGHT! YOU MAY BE WONDERING HOW IT IS POSSIBLE FOR 12345’ TO BE";`י" BOTH":™"A NUMBER AND’ A STRING.§ܙ"THE ANSWER IS THAT IT DEPENDS ON HOW THECOMPUTER HANDLES IT.":7Ôć™"THE CHARACTERS IN A STRING MAY INCLUDEë™"LETTERS, NUMBERS OR OTHER KEYBOARD":™"CHARACTERS AS WELL.":6:™"“QC$˛"Ř":3:™"END OF LESSON 4 PART 1]‘LKLKLK’V$˛"":™Ł9)"";:‹¸(0)ą999§406¨“™"PRESS SHIFT-RUN"V$:€Č–™"LOADING, PLEASE WAIT"V$:“8Q$˛"‘‘ ‘‘":‰18i™"ŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁŁ":Žš™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";ˇI˛1¤38:™""C$"";:‚:™C$ҁI˛1¤23:™"‘"C$"";:‚:ŽăĄA$:‹A$˛""§6ë™:Ž 7:™"TRY AGAIN!":7:™"“ Z$˛Ç(34)& I˛1¤1200:‚:Ž0™"";HI˛1¤UŤ1:™:‚:I˛U¤Ww™" "’‚:™"";:I˛1¤UŤ1:™:‚:ŽŸZ$˛Ç(34)Îd™"“ STRING VARIABLES (CONTINUED)":7á™"RECALL THAT A VARIABLE ALLOWS US TO":™"STORE A NUMBER IN THE COMPUTER]ć™"(E.G. INPUT A)":7:™"A STRING VARIABLE ALLOWS US TO STORE A"˘ë™"STRING IN THE COMPUTER.":7:™"A STRING VARIABLE IS DENOTED BY"ďđ™"ATTACHING A $’ TO A VARIABLE NAME.":7:™"FOR EXAMPLE:A$A9$ZO$6ő™"ARE STRING VARIABLES":7:™"WE CAN STORE A STRING IN THE COMPUTERyú™"BY USING A STRING VARIABLE AS FOLLOWS:":™Ł15)"INPUT A$’":7´˙™"OR OUTPUT A STRING AS FOLLOWS:":™Ł15)"PRINT A$’":6"™"“CONSIDER THE FOLLOWING PROGRAM:":™"10 PRINT ";Z$;"ENTER YOUR NAME AND";O'™" AGE";Z$:™"20 PRINT ";Z$;"(SEPARATED BY A COMMA)";Z$:™"40 INPUT N$,AŠ,™"80 PRINT N$ ";Z$;"IS ";Z$;" 365*A ";Z$;"DAYS OLD";Z$¸.7:™"CAN YOU FIGURE OUT WHAT WILL HAPPEN"÷1™"WHEN THIS PROGRAM IS RUN (YES OR NO)":…A$:™:‹A$˛"NO"§308 2‹ A$˛"YES"‰324 3™Q$:‰305h 4™"WHAT WE ARE TRYING TO DO WITH A STRING":™"VARIABLE IS TO ALLOW NON-NUMERICš 6™"DATA - LIKE NAMES, WORDS, ADDRESSES":™"ETC. - TO BE INPUT TO THE COMPUTER.ĺ 87:™"WHEN AN INPUT STATEMENT CONTAINS A :™"STRING VARIABLE - LIKE A$ - IT TELLST <™"THE COMPUTER TO EXPECT NON-NUMERIC DATA":™"TO BE ENTERED.":7¤ >™"WHEN A PRINT STATEMENT CONTAINS A":™"STRING VARIABLE - LIKE A$ - IT TELLSę @™"THE COMPUTER TO PRINT OUT NON-NUMERIC":™"DATA.":6:U˛6:W˛24:14ö B2:‰325 DU˛7:W˛26:14:2:™"SURE 'NUFF! ";` E™"THE PROGRAM WILL PRINT THE":™"THE USER'S NAME AS WELL AS AGE";› G™" IN DAYS.":7:™"LET'S CHECK THAT OUT BY RUNNING THE"ç J™"PROGRAM- (BE SURE TO ENTER YOUR NAME":™"AND AGE WHEN REQUESTED!):":7& L™"ENTER YOUR NAME AND AGE":™"(SEPARATED BY A COMMA)":…N$,AG N™N$" IS "365ŹA"DAYS OLD";:6a T™"“"Ł15)"EXPRESSIONSž V™"NUMERICAL DATA IS USED TO PERFORM":™"CALCULATIONS.":7ç X™"STANDARD ARITHMETIC OPERATIONS MAY BE PERFORMED IN BASIC USING";7 Z™" OPERATOR":™"SYMBOLS’ TO COMBINE NUMBERS(CONSTANTS) AND/OR VARIABLES.i \7:™"THE ARITHMETIC OPERATOR SYMBOLS ARE:":7§ ^™Ł8)"+’ FOR ADDITION":™Ł8)"-’ FOR SUBTRACTIONč `™Ł8)"*’ FOR MULTIPLICATION":™Ł8)"/’ FOR DIVISION2b™Ł8)"^’ FOR EXPONENTIATION(RAISE TO A POWER)"wd™Ł8)"( )’ FOR ALGEBRAIC GROUPINGOF OPERATIONS";Ż6:C$˛"Ř":3:™"END OF LESSON 4 PART 2ă’V$˛"":™"";:‹¸(0)ą999§410ţ“™"PRESS SHIFT-RUN"V$:€š™"LOADING, PLEASE WAIT"V$:“E›OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOlœJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ“PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP™ “%C.77JAMES&LODEWYCK209-634-8888fZ$˛Ç(34):Q$˛"‘ ‘‘‘":‰20—™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";´I˛1¤38:™""C$"";:‚:™C$ρI˛1¤23:™"‘"C$"";:‚:ŽŕĄA$:‹A$˛""§6č™:Ž 7:™"TRY AGAIN!":6:Ž Z$˛Ç(34)/™"":I˛1¤UŤ1:™:‚:I˛1¤24ŤUr™" ":‚:™"":I˛1¤UŤ1:™:‚xŽĄ™"“"Ł10)"EXPRESSIONS (CONTINUED)":7ăf™"EXAMPLES OF ARITHMETIC EXPRESSIONS":™"IN BASIC INCLUDE:":7h™Ł12)" X+2 ":™Ł12)" A*365 "Oj™Ł12)" R^2+A2/B3 ":™Ł12)" N-K9*Q "ol™Ł12)" (2*M-N)/(2*M+N)":7ˇr™"SINCE EACH VARIABLE REPRESENTS A NUMBER STORED IN THE COMPUTER,";t™"AN EVALUATED":™"EXRESSION REPRESENTS A SINGLE NUMERICAL VALUE.":6Jv™"“WHICH OF THE FOLLOWING IS NOT’ AN":™"ALLOWABLE BASIC EXPRESSION:"~w7:™Ł12)"1.’ S-.1*H*R":™Ł12)"2.’ 73/(Q*S*T)Ťx™Ł12)"3.’ B+365A":™"(1, 2 OR 3)";:…A$Ây‘Ĺ(A$)‰380,380,395Ďz™Q$:‰376ý|™"EVERYTHING O.K. IN THIS EXPRESSION":7K~™"THE COMPUTER WOULD EVALUATE THIS":™"EXPRESSION JUST AS YOU WOULD, WITH"™"STANDARD ARITHMETIC.":7:™"OF COURSE THE COMPUTER SHOULD HAVE"ş™"NUMERICAL DATA PREVIOUSLY STORED INč‚™"EACH OF THE VARIABLES BEFORE IT GOES TO „™"CALCULATE THE VALUE OF THE EXPRESSION.! …9:‰374] ‹™"": I˛1¤15:™"CORRECT!!!’CORRECT!!!‘":‚:7­ ™"THIS IS NOT AN EXCEPTABLE ARITHMETIC ":™"EXPRESSION IN BASIC BECAUSE THEó Ž™"MULTIPLICATION OPERATOR IS MISSING":™"BETWEEN 365’ AND A.":7! ™"THE CORRECT FORM WOULD BE: B+365*A":6I ™"“"Ł8)"HIERARCHY OF OPERATIONS":7˜ ’™"HOW TO COMPUTE THE VALUE OF AN":™"ARITHMETIC EXPRESSION CAN SOMETIMES BEĎ ”™"UNCLEAR.":7:™"LOOK AGAIN AT THE EXPRESSION:":7 –™Ł14)"B + 365*A":7:™"THE COMPUTED VALUE WILL BE DIFFERENT> ˜™"DEPENDING ON THE ORDER OF OPERATIONS.":7i š™"FOR EXAMPLE, IF A’ HAS THE VALUE 10Ż œ™"AND B’ HAS THE VALUE 9,":™"WE MIGHT INCORRECTLY’ COMPUTE:":7Ď ™" 9 + 365 = 374, THEN":7é ž™" 374*10 = 3740":69  ™"“TO REMOVE ANY AMBIGUITY, EXPRESSIONS":™"ARE PERFORMED IN THE FOLLOWING";j ˘™" ORDER:":7:™"1. EXPONENTIATION"Ł33)" ^ ’™ ¤™"2. MULTIPLICATION AND DIVISION"Ł33)"* /É Ś™"3. ADDITION AND SUBTRACTION"Ł33)"+ -":7 ¨™"TO FURTHER RESOLVE AMBIGUITY,":™"OPERATIONS OF THE SAME PRIORITY AREQ Ş™"CARRIED OUT FROM LEFT TO RIGHT.":7:™"FOR EXAMPLE:":7„ Ź™Ł14)"20/5*2":7:™"HAS THE VALUE 8, NOT 2.":6Ď Ž™"“THE ORDER IN WHICH YOU WANT THE":™"OPERATIONS TO BE CARRIED OUT CAN °™"ALWAYS BE CLARIFIED BY THE USE OF":™"PARENTHESES.":7Q˛™"HERE ARE A FEW EXAMPLES:":7:™Ł14)"(A+B)*2":™Ł14)"(X+2)*(X-2)e´™Ł14)"F-(G1-HH)ÂMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMľĚMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMÝ֏MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMۏLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL< 6:C$˛"Ř":3:™"END OF LESSON 4 PART 3q˘V$˛"":™"";:‹¸(0)ą999§4010Œ¤™"PRESS SHIFT-RUN"V$:€ŹŞ™"LOADING, PLEASE WAIT"V$:“3Q$˛"‘ ‘‘‘DZ$˛Ç(34):‰20u™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";’I˛1¤38:™""C$"";:‚:™C$­I˛1¤23:™"‘"C$"";:‚:ŽžĄA$:‹A$˛""§6Ć™:ŽŢ™"TRY AGAIN!":6:Ž ™"‘‘‘Ď";:I˛1¤37:™"Ł";:‚:™"Đ":™"Ľ"Ł38)"§":™"Ľ"Ł38)"§8 ™"Ě";:I˛1¤37:™"¤";:‚:™"ş":Ž^™"“"Ł9)"HIERARCHY (CONTINUED)":6žş™"“IF THE VARIABLES R, S, T HAVE THE":™"VALUES":™Ł12)"R = 4ťź™Ł12)"S = 7":™Ł12)"T = 9űž™"WHAT IS THE CORRECT VALUE OF THE":™"FOLLOWING EXPRESSION:EŔ7:™Ł12)"(S+3+2*R)/T+1’":™"(IF YOU HAVE NO IDEA, USE THE VALUE 0’)\™:…A:™:‹ A˛3 ‰ 470iĂ‹A˛0‰458ŹÄ™A" IS NOT CORRECT.":7:™"TO SEE THE CORRECT ANSWER ENTER CŇĹ™"TO TRY AGAIN"Ł28)"ENTER T":9éĆ™"(C OR T)";:…A$ůÇ‹A$˛"T"§442 Č‹A$˛"C"§458É™Q$:‰454cĘ™"“THE EXPRESSION (S+3+2*R)/T+1’ IS":™"CALCULATED TO BE 3’ AS FOLLOWS:“Ë™Ł8)" 2*R’ GIVES 8’ ,THEN":7:™Ł8);ŰĚ™"(S+3+8)’ GIVES 18’ ,THEN":7:™Ł8)" 18/T’ GIVES 2’ ,FINALLYýΙŁ8)" 2+1’ GIVES 3":6Љ500)Ö™"CORRECT - THE VALUE IS 3":6;ô™"“"Ł18)"LET‡ö™"A LET STATEMENT IS USED TO ASSIGN A":™"NUMERICAL OR A STRING VALUE ";Íř™"TO A":™"VARIABLE.":7:™"SOME EXAMPLES ARE:":7:™Ł8)"15 LET A=4 ú™Ł8)"25 LET R$=";Z$;"CRITICAL PATH";Z$:™Ł8)"30 X=X+1" ü™Ł8)"55 Z$=P$":6O ţ™"“THE FORMAT OF THE LET STATEMENT IS:":7” ™"LINE#’ LET VARIABLE NAME’ = EXPRESSION":™Ł26)"OR STRING ’Á 7:™"THE WORD LET’ MAY BE OMITTED.":7 ™"NOTE THAT THE =’ SYMBOL MEANS REPLACED BY’AND NOT’ EQUALS’.< 7:™"THUS THE STATEMENT":™Ł8)"30 LET X=X+1":7k ™"ADDS ONE TO THE VALUE STORED IN X’.":6ą ™"“WHICH OF THE FOLLOWING IS NOT’ A VALID LET’ STATEMENT:":7ů ™"535 LET 4=E":™"720 LET G=2*G+H":™"340 F$=";Z$;"YES";Z$:™"270 I=J"+ …"(535, 720, 340, OR 270)";A$:‹Ĺ(A$)˛535‰550> ‹Ĺ(A$)˛720‰540[ ‹Ĺ(A$)˛340°Ĺ(A$)˛270§532k ™Q$"":‰528ˇ ™"THIS IS A VALID LET’ STATEMENT.":7:™"THE WORD 'LET' IS OPTIONAL,";Ţ ™" AND MAY":™"BE OMITTED.":8:‰524( ™"THIS IS A VALID LET’ STATEMENT.":7:™"THE EFFECT IS TO MULTIPLY";l ™" G’ BY 2’,":™"THEN ADD H’ AND STORE THE RESULT IN G’.":8u ‰524… &™"CORRECT!Ď *™"ONLY A VARIABLE NAME IS ALLOWED TO THE LEFT OF THE =’ SYMBOL.":7ü 0™"BEFORE PROCEEDING TO LESSON 5, ATTEMPT& 2™"THE FOLLOWING HOMEWORK PROBLEM:":6r :™"“WRITE AND RUN A PROGRAM THAT WILL":™"CALCULATE A BASEBALL PLAYER'S";˝ <™" BATTING":™"AVERAGE. (1000 MULTIPLIED BY HITS":™"DIVIDED BY AT BATS)>7:™"THE PROGRAM SHOULD PROVIDE FOR USER":™"INPUT OF THE PLAYER'S ";H@™"NAME, THE NUMBER":™"OF AT BATS, AND THE NUMBER OF HITS.":7“B™"THE COMPUTER SHOULD PRINT OUT THE":™"PLAYER'S NAME, ALONG WITH HIS";˛D™" BATTING":™"AVERAGE.":7äI™:™"IT WOULD BE A GOOD IDEA TO COPY THIS "J™"DOWN BEFORE PRESSING THE SPACE BAR ":6FXC$˛"Ř":3:™""Ł13)"END OF LESSON 4b™"LOAD LESSON#5-1 AFTER COMPLETING":™"THE HOMEWORK PROBLEMžl™"¤v˘Z$˛Ç(34):‰10C™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";`I˛1¤38:™""C$"";:‚:™C${I˛1¤23:™"‘"C$"";:‚:ŽŒĄA$:‹A$˛""§6”™:ŽŘ C$˛"˙":3:™""Ł15)"LESSON 5":™Ł12)"1. HOMEWORK EXPLAINED ™Ł12)"2. IF/THEN STATEMENT":™Ł12)"3. GOTO STATEMENT2™Ł12)"4. HOMEWORK PROBLEM":6€™"“AT THE END OF LESSON 4 YOU WERE":™"ASKED TO WRITE A PROGRAM THAT WOULDź™"CALCULATE A BASEBALL PLAYER'S":™"BATTING AVERAGE.":7ü™"THERE ARE SEVERAL CORRECT WAYS THIS":™"COULD BE DONE.":7D™"HERE IS ONE WAY:":6:™"“2 PRINT "Z$"ENTER NAME, HITS & AT-BATS"Z$q™"4 INPUT N$, H, B":™"6 LET A = 1000*H/Bľ™"8 PRINT N$ "Z$" BATTING AVERAGE "Z$" ;A":I˛1¤39:™"¨";:‚:™:7ó™"LET'S SEE WHAT HAPPENS WHEN WE RUN":™"THIS PROGRAM.":77™"BE SURE TO ENTER A NAME AND TWO’":™"NUMBERS WHEN ASKED’":7h ™"RUN":™"ENTER NAME, HITS & AT-BATS":…N$,H,B"™N$;" BATTING AVERAGE ";1000ŹH­B:6É$™"“"Ł16)"IF/THEN":7:™"COMPUTER PROGRAMS CAN BE MADE÷&™"CONSIDERABLY MORE FLEXIBLE AND POWERFUL*(™"THROUGH THE USE OF BRANCHING STATEMENTS.":7u*™"CONSIDER THE FOLLOWING EXAMPLE:":6:™"“2 PRINT "Z$"ENTER YOUR AGE"Z$ł,™"4 INPUT A":™"6 PRINT"Z$"DO YOU WANT DAYS (YES OR NO)"Z$ă.™"8 INPUT B$":™"10IF B$="Z$"NO"Z$" THEN 14" 0™"12PRINT "Z$"AGE IS"Z$" 365*A "Z$"DAYS"Z$K 2™"14PRINT "Z$"AGE IS"Z$" 12*A "Z$"MONTHS"Z$:7:Y1˛10a <I˛1¤39:™"¨";:‚:™° P™"LET'S GO THROUGH THE PROGRAM A LINE AT":™"A TIME, AS THE COMPUTER WOULDř R7:™"LINE 2 INSTRUCTS THE COMPUTER TO PRINT":™"ENTER YOUR AGE’":7G T™"LINE 4 INSTRUCTS THE COMPUTER TO PRINT":™"A ?’ AND WAIT FOR THE USER TO‚ V™"ENTER A NUMBER (HIS AGE), FOR EXAMPLE:":™"? 21’":7Ż X™"LINE 6 INSTRUCTS THE COMPUTER TO PRINT× Z™"DO YOU WANT DAYS (YES OR NO)":6 \Y2˛24:5000:6000:™"LINE 8 INSTRUCTS THE COMPUTER TO PRINTf ^™"?’ AND WAIT FOR THE USER TO ENTER":™"YES OR NO. FOR EXAMPLE:":™"? YES’ž `6:5000:6000:™"LINE 10 INSTRUCTS THE COMPUTER TOî b™"EXAMINE THE STRING STORED IN B$ AND":™"JUMP TO LINE 14 (SKIPPING LINE 12)( d™"IF B$=NO":7:™"IF B$ DOES NOT EQUAL NO THE COMPUTERt f™"PROCEEDS AS NORMAL TO LINE 12.":7:™"IF LINE 14 IS NEXT, THE COMPUTERŹ h™"IS INSTRUCTED TO PRINT":™"AGE IS 120 MONTHS’":7Ů j™"THEN THE PROGRAM ENDS.":6:5000:6000 l™"IF LINE 12 IS NEXT, THE COMPUTER WILL":™"FIRST PRINTS n™"AGE IS 3650 DAYS’":7:™"THEN LINE 14 WILL INSTRUCT THEŸ p™"COMPUTER TO PRINT:":™"AGE IS 120 MONTHS’":7:™"THEN THE PROGRAM ENDSŤ r6:‰400ű t™"YES, THE PROGRAM ALLOWS THE USER TO":™"SPECIFY WHETHER THE AGE SHOULD BEGv™"PRINTED IN MONTHS ONLY (NO’) OR BOTH":™"DAYS AND MONTHS (YES’).":6xC$˛"˙":3:™""Ł9)"END OF LESSON 5 PART 1Š’V$˛"":™Ł9)"";:‹¸(0)ą999§7000Ä“™"PRESS SHIFT-RUN"V$:€ďˆ™"";:I˛1¤Y1:™"";:‚:™"‘";:J˛0¤Y2ŤY1"‰™" ":‚:ŽDp™"";:I˛1¤Y1:™"";:‚:™"‘";:ŽM–MMMs LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLyޏ™X™"LOADING, PLEASE WAIT"V$:“4Q$˛"‘ ‘‘"EZ$˛Ç(34):‰10v™"“":I˛1¤39:™C$;:‚:I˛1¤22:™""C$;:‚:™"";“I˛1¤38:™""C$"";:‚:™C$ŽI˛1¤23:™"‘"C$"";:‚:ŽżĄA$:‹A$˛""§6Ç™:Žő ™"“ IF/THEN STATEMENT (CONTINUED)":6@‚™"“THE IFÎTHEN STATEMENT IS USED TO":™"TRANSFER CONDITIONALLY FROM THE‘„™"NORMAL CONSECUTIVE ORDER OF STATEMENT":™"NUMBERS, DEPENDING UPON THE TRUTH׆™"OF SOME RELATION.":7:™"THE FORMAT OF THE IFÎTHEN STATEMENT IS: ˆ™" LINE #1’ IF CONDITION’ THEN LINE #2’":6'ŠI˛1¤22:™:‚:Y1˛4:6000vŒ™"A CONDITION’ IS FORMED BY SEPARATING TWO":™"EXPRESSIONS WITH ONE OF THEşŽ™"FOLLOWING RELATIONAL OPERATORS:":7:™" OPERATOR’ MEANING’™" = EQUAL":™" > GREATER THAN":™" < LESS THANL’™" >= GREATER THAN OR EQUAL":™" <= LESS THAN OR EQUALŠ”™" <> NOT EQUAL":7:™"THE CONDITION IS TESTED.":7Ř–™"‘IF THE CONDITION IS FOUND TRUE, THEN":™"LINE #2 WILL BE THE NEXT TO BE˜™"EXECUTED.":7:™"IF THE CONDITION IS FOUND FALSE,Jš™"THEN THE LINE FOLLOWING LINE #1 WILL":™"BE NEXT.":6œ™"“THE FOLLOWING ARE EXAMPLES OF THE":™"IFÎTHEN STATEMENT:":7Ŕž™"2 IF A=0 THEN 10":7:™"4 IF X<=99 THEN 2":7៙"6 IF R+W>P-T+1 THEN 55":7  ™"8 IF M^N<>50 THEN 34":6I ˘™"“WHICH OF THE FOLLOWING IS NOT’ A":™"VALID IFÎTHEN STATEMENT:":7• ¤™"1 IF A=2*B+CC THEN 10":™"2 IF P*3+U/1.5 > THEN 18":™"3 IF M=N THEN 19Ż Ś™:™"(1, 2 OR 3)";:…X$Ć §‘Ĺ(X$)‰170,174,170Ó ¨™Q$:‰166 Ş™"THIS STATEMENT FOLLOWS THE REQUIRED":™"FORMAT PERFECTLY.":71 Ź™"TRY AGAIN!":6:‰162} Ž™"THAT'S RIGHT, AN EXPRESSION IS":™"NECESSARY TO THE RIGHT OF THE >’.‰ Ż6:‰200Ů °™"“SINCE THE IFÎTHEN STATEMENT IS A":™"COMPLICATED INSTRUCTION, PERHAPS YOU" ˛™"WOULD LIKE TO REVIEW THIS SECTION":…"(YES OR NO)";A$:‹A$˛"YES"§1303 ł‹A$˛"NO"§400@ ´™Q$:‰178 ș"“ANOTHER FORM OF THE IFÎTHEN STATEMENT":™"IS ALSO ALLOWED ON YOUR PET:Ä Ę7:™" LINE #’ IF CONDITION’ THEN STATEMENT":7 ̙"IF THE CONDITION’ IS TRUE, THEN":™"STATEMENT’ IS EXECUTED.":7Y ͙"AFTER STATEMENT’ IS EXECUTED, THE":™"STATEMENT FOLLOWING LINE #’ WILL‚ Ι"BE NEXT IN ORDER OF EXECUTION.":7Рϙ"IF THE CONDITION’ IS FALSE, STATEMENT":™"IS IGNORED AND THE STATEMENT˙ Й"FOLLOWING LINE #’ IS EXECUTED NEXT.":7H љ"HERE ARE SOME EXAMPLES:":7:™" 45 IF X>12 THEN PRINT "Z$"YES"Z$:™ ҙ" 65 IF A$="Z$"NO"Z$" THEN INPUT B$":™:™" 8 IF R=T THEN V=V+1":™˛ ԙ" 7 IF L>=100 THEN END";:6ť ú‰176ě C$˛"˙":3:™""Ł9)"END OF LESSON 5 PART 2=’™"PLEASE WAIT WHILE THE COMPUTER":™"LOADS LESSON#5-3 INTO MEMORYN“™"X”‰7000čLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLŚéLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLÍęLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLôëLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLˆ™"";:I˛1¤Y1:™"";:‚:™"‘";:J˛0¤Y2ŤY1R‰™" ":‚:Žtp™"";:I˛1¤Y1:™"";:‚:™"‘";:ŽzX“