
-----------------------------------
skatelhs
Thu May 22, 2003 12:28 pm

Quick Question... Answer ASAP!!!!!
-----------------------------------
Ok, whoever can answer this for me, i will be eternally grateful.  

"Declare an array of strings which will hold 3 names: ann, dan, leo (static initialised)
Prompt the user to enter the age for these names (One at a time, in a loop)
Store these ages in another array.  Display what you got (People and their age).
Prompt the user to enter a name
If the entered name is from the above list (ann or dan or leo) the program will change the first letter into a capital letter and it will display the person's age.  If the user will enter any other name the program will stop there.
The output wiill look like (Of course, entered age is the users' chooice; also the name to look up)

     Enter the age for ann:11
     Enter the age for leo:22
     Enter the age for dan:33

     Names and Ages are:
     ann 11
     leo 22
     dan 33

     You want to know hoe old is: dan
     Dan is 33 years old"

Theres the test question ive gotta do in the next hour.  If someone could PLEASE give me the turing code for this I'd do anything.

Thanks.

p.s. please leave the answer here!

MOD EDIT: Excellent use of your resourses +20 bits - Darkness 

-----------------------------------
Solo
Thu May 22, 2003 12:43 pm

Try this :)
-----------------------------------
var names : array 1 .. 3 of string := init ("ann", "leo", "dan")
var ages : array 1 .. 3 of int
var ans : string

for i : 1 .. 3
    put "Enter the age for ", names (i), ":" ..
    get ages (i)
end for

put "Names and Ages are:"
for i : 1 .. 3
    put names (i), " ", ages (i)
end for

put "You want to know how old is: " ..
get ans
for i : 1 .. 3
    if ans = names (i) then
        put chr (ord (names (i) (1)) - 32), names (i) (2 .. *), " is ", ages (i), " years old."
        exit
    end if
end for

MOD EDIT: What the hell? Encouraging cheating?! Minus 50 bits -Darkness

-----------------------------------
Martin
Thu May 22, 2003 12:46 pm


-----------------------------------
lol, good job guys. You're devious :twisted:

-----------------------------------
skatelhs
Thu May 22, 2003 12:46 pm

THANKS!
-----------------------------------
THANK YOU SO MUCH
I just passed my test... your the best, man!
i am sooo grateful.  thanks. hey id even send you a cheque in the mail.  thank you SO much!

-----------------------------------
Martin
Thu May 22, 2003 12:48 pm


-----------------------------------
lol
Any more questions left?(we'll get you a 100 ;))

-----------------------------------
skatelhs
Thu May 22, 2003 12:53 pm


-----------------------------------
Hey,
no, thats it! the whole damn test.  you just got me perfect!
Actually if you want to do somethin real nice... You can make a seperate copy of that assignment, for my freind.  just different variable names and stuff so it doesnt look like he cheated.  That would be super.
thanks guys!
adam

-----------------------------------
Solo
Thu May 22, 2003 12:55 pm

Are you kidding me?
-----------------------------------
First of all, i helped you to be nice... if you cant make another one with DIFFERENT variable names, you shouldnt be in a computer science class..... nor should you have passed that test.

please dont abuse.

-----------------------------------
Martin
Thu May 22, 2003 12:56 pm


-----------------------------------
What school do you go to skat?

-----------------------------------
skatelhs
Thu May 22, 2003 12:58 pm


-----------------------------------
hey,
well im just an idiot anyway, and im in compsci because i need a computer credit.  And everyone wants your answers because... Your really smart and your answers are the best!
And yeah i know you were just bein nice, and im pushin it now.  Thanks for the first answer tho!  (By the way, I know none of this turing stuff because my teacher doesnt speak english and i spend just about every day in the office, shes a real b!tch!)
thanks guys
adam

-----------------------------------
skatelhs
Thu May 22, 2003 12:59 pm


-----------------------------------
I go to LHS, as in skatelhs, and its Leaside High Scool in east york, toronto.  im in grade 10.

-----------------------------------
Martin
Thu May 22, 2003 1:01 pm


-----------------------------------
Alright man, spamming the site was pretty low. I cleaned up most of it, but don't do it again. Else the consequences will be dire.

-----------------------------------
skatelhs
Thu May 22, 2003 1:02 pm


-----------------------------------
Sorry man!
i just needed an answer real quick... really sorry.  great site by the way.,

-----------------------------------
kythoon
Thu May 22, 2003 4:11 pm


-----------------------------------
really, that it like across the street from me

but i dont go there, i go to a private school, UCC

-----------------------------------
ShadowStorm
Thu May 22, 2003 4:19 pm


-----------------------------------
Hey i go to UCC to .... do i know you???

(jkd, dutton) ;)

-----------------------------------
Asok
Thu May 22, 2003 4:36 pm


-----------------------------------
SWAT does not promote cheating. This forum is not to be used to cheat on test/ISPs as that is not the function of this site. Spamming the forums will result in getting banned so don't do that again, you've been warned. - Asok
