Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Quick Question... Answer ASAP!!!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
skatelhs




PostPosted: Thu May 22, 2003 12:28 pm   Post subject: 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
Sponsor
Sponsor
Sponsor
sponsor
Solo




PostPosted: Thu May 22, 2003 12:43 pm   Post subject: Try this :)

code:
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




PostPosted: Thu May 22, 2003 12:46 pm   Post subject: (No subject)

lol, good job guys. You're devious Twisted Evil
skatelhs




PostPosted: Thu May 22, 2003 12:46 pm   Post subject: 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




PostPosted: Thu May 22, 2003 12:48 pm   Post subject: (No subject)

lol
Any more questions left?(we'll get you a 100 Wink)
skatelhs




PostPosted: Thu May 22, 2003 12:53 pm   Post subject: (No subject)

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




PostPosted: Thu May 22, 2003 12:55 pm   Post subject: 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




PostPosted: Thu May 22, 2003 12:56 pm   Post subject: (No subject)

What school do you go to skat?
Sponsor
Sponsor
Sponsor
sponsor
skatelhs




PostPosted: Thu May 22, 2003 12:58 pm   Post subject: (No subject)

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




PostPosted: Thu May 22, 2003 12:59 pm   Post subject: (No subject)

I go to LHS, as in skatelhs, and its Leaside High Scool in east york, toronto. im in grade 10.
Martin




PostPosted: Thu May 22, 2003 1:01 pm   Post subject: (No subject)

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




PostPosted: Thu May 22, 2003 1:02 pm   Post subject: (No subject)

Sorry man!
i just needed an answer real quick... really sorry. great site by the way.,
kythoon




PostPosted: Thu May 22, 2003 4:11 pm   Post subject: (No subject)

really, that it like across the street from me

but i dont go there, i go to a private school, UCC
ShadowStorm




PostPosted: Thu May 22, 2003 4:19 pm   Post subject: (No subject)

Hey i go to UCC to .... do i know you???

(jkd, dutton) Wink
Asok




PostPosted: Thu May 22, 2003 4:36 pm   Post subject: (No subject)

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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: