Legos, Java, Programming Assignments and CS1

Download Report

Transcript Legos, Java, Programming Assignments and CS1

Legos, Java, Programming Assignments and CS1 An assignment scenario

David J. Barnes The University of Kent at Canterbury [email protected]

http://www.cs.ukc.ac.uk/~djb/ ACM SIGCSE 2003

Context

 I use LEGO ® Mindstorms™ computer controlled models as a motivational tool.

– As additional material in my teaching.

– As part of a promotional talk to prospective students.

– With school children.

 Paper in SIGCSE 2002 on pedagogical issues with their use for teaching Java.

ACM SIGCSE 2003

Criteria for scenario selection

 The scenario should be interesting.

 Possibly grounded in the ‘real-world’.

 Rich in possibilities for discussion.

– Collateral learning is very important to me.

 It should present design alternatives.

– Software.

– Legoware.

ACM SIGCSE 2003

The Time-Team scenario

Caveat

: this is possibly not an original idea.

– OO = = reuse   A scenario for using arrays.

 The task is to ‘map’ an area in some way.

– Geophysical mapping by archaeologists.

– Ground-surface mapping for navigation.

– Mobile temperature mapping.

ACM SIGCSE 2003

Constraints of the scenario

 The data is to be visualised on a PC.

 The amount of data to be gathered is too much to fit fully in the model’s limited memory.

 Communication with the PC must be ‘face to-face’.

– The IR transmitter of the RCX must be directed to the IR tower of the PC.

ACM SIGCSE 2003

Host PC Tower Area to be Mapped

Discussion

 RCX to PC communication is not a problem: – rcxcomm package from DTU.

 Could the model read and transmit values one at a time?

 How can the model store a collection of values to be sent as a group?

 What sort of path should the model follow?

ACM SIGCSE 2003

Discussion

 How do we take ‘regular’ readings?

 What characteristics does the model need to provide values that are meaningful?

 Others?

ACM SIGCSE 2003

Implementation

 Once the issues have been addressed, a particular model could be provided.

– Plus software to drive the model at an appropriate level of abstraction.

– This keeps the focus on array manipulation.

 The host visualisation could also be provided – a simple JFrame with a JPanel .

ACM SIGCSE 2003

Extension ideas

 Use a temperature sensor for temperature mapping.

– Physical accuracy in the model is probably less of an issue.

– Readings may take longer.

 Since maps are often for the purpose of navigation, have the host instruct the model to go somewhere based on the map data.

ACM SIGCSE 2003

Summary

 Mindstorms models provide a valuable tool for creating credible real-world scenarios.

 Appropriate scenarios can provide a rich source for discussion as well as a vehicle for use of particular language features.

ACM SIGCSE 2003