Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
I need help please.........I am so lost.....
Old
eternitychlex
Junior Member
 
Status: Offline
Posts: 2
Join Date: Sep 2011
Default I need help please.........I am so lost..... - 10-06-2011, 07:43 PM

1.Create an Alice world with a list of 3 objects from People gallery and a list of 3 objects from Animals gallery. Create a method that make each person in the People list to say 'hello' to each animal in the Animals list. The program should work for any number of objects on these lists. Make sure to comment your program.

2.Attached is an Alice world that defines a variable array called numberArray of 6 numbers and asks the user to enter values for each element in the array.
Add to the attached program a block of code that traverses the array and determines the largest value after the user enters the values. Let the character say it.

Here is an algorithm to determine the largest value in an array.

largestValue = numberArray value at index 0
myIndex = 1
while myIndex < size of the the array
if numberArray value at myIndex is greater than largestValue
largestValue = numberArray value at index myIndex
incerement myIndex by 1
end while
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.