|
-
Sep 19th, 2000, 03:47 PM
#1
Thread Starter
Frenzied Member
I'm not sure if our math teacher was drunk or not but he gave us 1-13 on page 29 and number 13 is the following:
13. a. Fill in the blanks to complete this BASIC program which computes area and perimeter of regtanckes
10 Print "AREA AND PERIMETER OF A REGTANGLE"
20 INPUT "LENGHT"; L
30 INPUT "WIDTH"; W
40 LET A = ___?____
50 LET B = ___?____
60 PRINT "AREA", "PERIMETER"
70 PRINT A, P
80 END
now how the hell do I solve this? so I enter any numbers? becuase I'm not sure what the hell he wants from me
(this is honors math for 8th grade, not programming)
NXSupport - Your one-stop source for computer help
-
Sep 19th, 2000, 03:52 PM
#2
Frenzied Member
I don't know what the 10 20 30...etc. are for but try this:
10 Print "AREA AND PERIMETER OF A REGTANGLE"
20 INPUT "LENGHT"; L
30 INPUT "WIDTH"; W
40 LET A = L*W
50 LET B = L*2 + W*2
60 PRINT "AREA", "PERIMETER"
70 PRINT A, P
80 END
-
Sep 19th, 2000, 04:01 PM
#3
Lively Member
I always thought the 10, 20, 30, etc. were just numbering the lines. When I was little I saw a BBC BASIC machine with that numbering system, but I can't say I'm that familiar with it. They're also used to allow you to skip back to a line of code (looping!?!?) - Go To 20 for instance - something like that. Am I making sense? I'm making sense to me, and that's all that counts :P
-
Sep 19th, 2000, 04:02 PM
#4
Hyperactive Member
The 10, 20, 30... are used in the Basic programming language. As far as the triangle problem, it depends on the type of triangle in question. If A = B then B=C if it is
a semetrical triangle, right angle triangles differ in this aspect. So, you see the answer is obvious!
The instructer is drunk!
Lee
 Mahalo 
VB6(SP5), VC++, COBOL, Basic, JAVA
MBA, MCSD, MCSE, A+
Computer Forensics
-
Sep 19th, 2000, 04:04 PM
#5
dimava: Not that it matters unless you want to run the little program, but Line 70 should probably be
70 PRINT A, B
SteveCRM: The 10, 20, 30 etc are line numbers from an old (non-Visual) Basic program.
-
Sep 19th, 2000, 04:12 PM
#6
Wow, I'm getting old.
Those numbers "10 20 30...etc." are called "line numbers". Back in the day, when BASIC was basic, they would be a reference of what order to interpret a line in an ascending manner. The habit was to go by 10's or 100's or so, then if you needed to add a line in between asy 10 and 20, you might label it line number 15; then maybe 12 between 10 and 15, and then 11 between 10 and 12. You tended to run out of lines "in between".
Then there were "line re-numbering" programs that were all the rage which would resequence the numbers 10,11,12,15,20,30,... back to 10,20,30,40,50,60,... for example.
Then someone realized that we could just execute the lines in the order they are saved and eliminate the line numbers. But sometimes you need a "label" to go to a subroutine.
Then came modular programming with the subroutines being labeled similar to VB. But now we have OOP.
BTW, "CC:" in your email means "carbon copy" from the days when physical special paper by the name of "carbon paper" was placed underneath say a blank sheet of paper, underwhich you'd place another blank sheet. The blank sheets would "sandwich" the carbon paper. You would take a pen or pencil (still used today) and the writing pressure on the top sheet would make a mark on the bottom blank sheet, creating a copy.
Now we can create a list of email recipients or make viruses that compile email directories and send multiple copies in seconds. We've come a long way baby.
-
Sep 19th, 2000, 04:29 PM
#7
Thread Starter
Frenzied Member
thanks all, I got the answer, when I was posting I wrote A & B instead of A (Area) and P (perimeter)
so A = L * W
and P = L * 2 + W * 2
that is what Steve said, and after reviewing it for like 5 minutes, I realized that he was correct. And why would anyone write the commands to BASIC into my math book?
NXSupport - Your one-stop source for computer help
-
Sep 19th, 2000, 04:32 PM
#8
Monday Morning Lunatic
Aah...BBC BASIC
Because it's simple to learn and ubiquitous. I still remember programming BASIC on the BBC B back in the 80s.
Also, what year was your maths book published in?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 19th, 2000, 04:34 PM
#9
...why would anyone write the commands to BASIC into my math book?
Because a lot of math problems are solved via computer programs, and giving students a glimpse of computer programming might make them interested in it as a career.
-
Sep 19th, 2000, 04:34 PM
#10
Thread Starter
Frenzied Member
I'm not sure but is says:
Copy Right 1998, 1996
but inside by book it says (in pen) RECIEVED 9/97
NXSupport - Your one-stop source for computer help
-
Sep 19th, 2000, 04:53 PM
#11
Lively Member
dimava:
1) whoever wrote "RECIEVED", you should tell them it's spelt "RECEIVED". Much the same as "colour" is not spelt with a missing "u" [NB/ HARBOUR, SPECIALITY, ETC.]
2) what's 9th grade?
-
Sep 19th, 2000, 04:55 PM
#12
Thread Starter
Frenzied Member
I made a mistake on that, its 8th grade (before HighSchool)
and color and colour is just an opinon, both mean the same thing, its just that in the USA they tend to use color more often
NXSupport - Your one-stop source for computer help
-
Sep 19th, 2000, 04:57 PM
#13
Monday Morning Lunatic
samdv - 9th grade is just a school year, a bit like us and our Year system.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 19th, 2000, 05:02 PM
#14
Frenzied Member
The reason there is BASIC in your maths book is because the guy who wrote it was 'past it.'
Some time in their 30s mathematicians go through something called burn out. this means that they can't do cutting edge maths anymore and they have to spend the time that they used to spend making up new equations doing something else.
The reason burn out happens is that as you aproach middle age you loose the ability to accept new Ideas at the rate you need to to to do serious maths research.
alot of the time after that they start writing text books.
so the guy who wrote your book was probably a burnt out mathematician, and BASIC was probably the language he used in his hayday (although it was probably pascal but he chose BASIC for the book because it's easier to understand for non programmers.
-
Sep 19th, 2000, 05:04 PM
#15
Thread Starter
Frenzied Member
I would consider myself to be a VB programmer, and I still have a hard time understanding BASIC
NXSupport - Your one-stop source for computer help
-
Sep 19th, 2000, 05:06 PM
#16
Lively Member
OK, perhaps my short but sweet wording of question 2) was a bit too short. I understand that it's a part of the year system of schools in the US. That much I've gathered from american films. However, when I said what is the ninth grade I meant what is it in terms I understand (saying pre-highschool is also not altogether useful). How old are you when you start in first grade, etc. Is that kindergarten? When's high school? Is college the same as university or 6th form college?
Any americans out there who'd care to clarify? :S
-
Sep 19th, 2000, 05:12 PM
#17
Thread Starter
Frenzied Member
ok, kindergarden is just a place where you goto before 1st grade, you just lpay around and learn some letters
Ages for grades:
Code:
'*********Elementary
1st Grade 6 (or turning 6)
2nd Grade 7 (or turning 7)
3rd Grade 8 (or turning 8)
4th Grade 9 (or turning 9)
5th Grade 10 (or turning 10)
'*********Middle School
6th Grade 11 (or turning 11)
7th Grade 12 (or turning 12)
8th Grade 13 (or turning 13)
'*********HighSchool
9th Grade 14 (or turning 14)
10th Grade 15 (or turning 15)
11th Grade 16 (or turning 16)
12th Grade 17 (or turning 17)
After that you goto a Colledge (Optional) and its the same thing as a university
hope that is what you wanted
NXSupport - Your one-stop source for computer help
-
Sep 19th, 2000, 05:18 PM
#18
Lively Member
Dimava: cheers - now I can watch american films and understand what the hell they're talking about 
Sam Finch: remember that not all mathematicians burn out during their 30s - Paul Erdos (Hungarian, I think; Erdos is pronounced "AIR DISH") carried on producing great work until his death in his 60s or 70s. Also, the head of maths at my old school suffered burn out at about 8. At least it seemed like that...
-
Sep 19th, 2000, 05:21 PM
#19
Monday Morning Lunatic
samdv - your sig: did you watch So Graham Norton as well, then?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 19th, 2000, 05:26 PM
#20
Lively Member
parksie - LOL. Sure - I'm upgrading to Microsoft DoggiePhone 7.0 soon
-
Sep 19th, 2000, 06:37 PM
#21
psssst.... dimava
After that you goto a College (Optional) and its the same thing as a university
goto is evil 
NO DISCUSSIONS ON THIS PLEASE, I WAS JUST KIDDIN'!!
-
Sep 19th, 2000, 06:50 PM
#22
So Unbanned
dimava:
You forgot Pre-School!
to samdv:
If you live in france color may have a u. Kind of like blond, are you blonde?
---
Main Entry: col·our
Pronunciation: 'k&-l&r
chiefly British variant of COLOR
Main Entry: 1col·or
Pronunciation: 'k&-l&r
Function: noun
Usage: often attributive
Etymology: Middle English colour, from Old French.
---
-
Sep 20th, 2000, 07:23 AM
#23
Lively Member
DiGiTaIErRoR: Thanks for that useful explanation about colour, with "u"s or no "u"s. Also, if you live in France, colour would actually have 2 u's. Thankfully, I'm neither blond nor blonde.
-
Sep 20th, 2000, 08:25 AM
#24
Hyperactive Member
Just want to add
Universitys usually have more choices of degree and a wider range of sports, oganizations. Also most community colleges only teach 2 year degrees. A lot of people like myself consider a college(Especially community) the school before the university. Since the college classes seem to be cheaper then universitys you take your preqs there and transfer your credits to the university. Hope that clarifys that a little more.
-RaY
VB .Net 2010 (Ultimate)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|