commit 98715851064ab7bcbee19a545c654aa3b9739a5e Author: John Paul Wohlscheid Date: Tue Jul 2 00:03:07 2019 -0400 Initial commit diff --git a/basic/hilo.bas b/basic/hilo.bas new file mode 100644 index 0000000..3518d3f --- /dev/null +++ b/basic/hilo.bas @@ -0,0 +1,39 @@ +' Here is an interactive HI-LO +' Program +[start] + guessMe = int(rnd(1)*100) + 1 + 'Clear the screen and print the title and instructions + cls + print + print HI-LO + print + print "I have decided on a number between" + print "a hundred, and I want you to guess" + print "what it is. I will tell you to guess" + print "higher or lower, and we'll count up" + print "the number of guesses you use." + print + +[ask] + ' Ask the user to guess the number and tally the guess + input "OK. What is your guess"; guess + ' Now add one to the count variable to count the guesses + let count = count + 1 + ' Check to see if the guess is right + if guess = guessMe then goto [win] + ' Check to see if the guess is too low + if guess < guessMe then print "Guess higher." + ' Check to see if the guess is too high + if guess > guessMe then print "Guess lower" + ' Go back and ask again + goto [ask] +[win] + ' Tell how many guess it took to win + print "You win! It took "; count; " guesses." + ' Reset the count variable to zero for the next game + let ocunt = 0 + ' Ask to play again + input "Play again (Y/N)"; play$ + if instr("YESyes", play$) > 0 then goto [start] + print "Press ALT-F4 to close this window." + end diff --git a/basic/salestax.bas b/basic/salestax.bas new file mode 100644 index 0000000..cf02a59 --- /dev/null +++ b/basic/salestax.bas @@ -0,0 +1,19 @@ +[start] + print "Type a dollar and cent ammount." + input "(Press 'Enter' alone for help) ?" ; amount + if amount = 0 then goto [help] + let tax = amount * 0.05 + print "Tax is: "; tax; ". Total is: "; tax + amount + goto [start] + +[help] + cls + print "SALETAX.BAS Help" + print + print "This tax program determines how much tax is" + print "due on an amount entered and also computes" + print "the total amount. The tax rate is 5%" + print + input "Press [Enter] to continue."; dummyVariable + print + goto [start] diff --git a/python/areacircle.py b/python/areacircle.py new file mode 100644 index 0000000..108e757 --- /dev/null +++ b/python/areacircle.py @@ -0,0 +1,5 @@ +pi = 3.14159 + +r = 10 + +print(pi * r ** 2) diff --git a/python/birthday.py b/python/birthday.py new file mode 100644 index 0000000..62646ae --- /dev/null +++ b/python/birthday.py @@ -0,0 +1,5 @@ +value = input('How old are you?:') + +year = 1 + +print("Next year you will be", int(value) + int(year)) diff --git a/python/birthday2.py b/python/birthday2.py new file mode 100644 index 0000000..c4f52d5 --- /dev/null +++ b/python/birthday2.py @@ -0,0 +1,5 @@ +value = input('How old are you?:') + +year = input('How many years until your next birthday?') + +print("Next year you will be", int(value) + int(year)) diff --git a/python/hello.py b/python/hello.py new file mode 100644 index 0000000..8cde782 --- /dev/null +++ b/python/hello.py @@ -0,0 +1 @@ +print("hello world") diff --git a/python/iden.py b/python/iden.py new file mode 100644 index 0000000..c78ba2b --- /dev/null +++ b/python/iden.py @@ -0,0 +1,10 @@ +name = "Matt" +first = name +age = 1000 +print(id(age)) +age = age + 1 +print(id(age)) +names = [] +print(id(names)) +names.append("Fred") +print(id(names)) diff --git a/python/idne.py b/python/idne.py new file mode 100644 index 0000000..9faa0b6 --- /dev/null +++ b/python/idne.py @@ -0,0 +1,10 @@ +name = "Matt" +first = name +age = 1000 +print(id(age)) +age = age + 1 +print(id(age)) +names = [] +print(id(names)) +names.append("Fred") +print(id(names}} diff --git a/python/parameterrectangle.py b/python/parameterrectangle.py new file mode 100644 index 0000000..f1e8354 --- /dev/null +++ b/python/parameterrectangle.py @@ -0,0 +1,5 @@ +b = 6 + +h = 2 + +print(2 * (b + h))