Ask a New Question

Question

read the names and age of 10 people and print the name of the oldest person.assume that there are no person of the same age.data is supplied in the following form:name,age,name,age
3 years ago

Answers

oobleck
maxage = 0
for i=1..10
read name,age
if age > maxage {
maxage = age
maxname = name
}
next i
print maxname
3 years ago

Related Questions

Read the passage from "Names/Nombres" by Julia Alvarez. My mother blushed and admitted her baby's... Read the passage from "Names/Nombres" by Julia Alvarez. By the time I was in high school, I was a... Read the passage from "Names/Nombres" by Julia Alvarez. When we arrived in New York City, our nam... Read the passage from "Names/Nombres" by Julia Alvarez. I was too afraid we wouldn't be let in if... Read the passage from "Names/Nombres" by Julia Alvarez. Introducing them to my friends was a furt... Read the passage from "Names/Nombres" by Julia Alvarez. My Dominican heritage was never more appa... Read the passage from "Names/Nombres" by Julia Alvarez. “Say your name in Spanish, oh, please say... Read the passage from "Names/Nombres" by Julia Alvarez. She was plain Anne – that is, only her na... Read the passage from "Names/Nombres" by Julia Alvarez. By the time I was in high school, I was a... Read the passage from "Names/Nombres" by Julia Alvarez. By the time I was in high school, I was a...
Ask a New Question
Archives Contact Us Privacy Policy Terms of Use