Lab 0
Objectives
To be able to translate a Python program to Java.
To be able to develop and run a complete Java program.
To be able to compile and run a Java program on unix1-4
Resources
1.Your text.
2.Your peers.
3.Your instructor.
4.The Java Standard Library - Bookmark this web page, you will be using the Java Standard Library documentation regularly this quarter.
Ground Rules
You may collaborate with your peers as much as you like on this lab. Labs are for your practice. Make sure you can do every lab!
Orientation – Explicit Types, semi-colons, and curly braces… oh my!
This lab is designed to highlight many of the differences between Python and Java. Many of the differences are purely syntactical. Other features, like for loops, function differently. Don't forget your semi-colons!
Specification
1.Download and run lab00.py. Make sure you understand how everything in this file works. If you need help (or haven’t learned Python) please ask me or a classmate to explain things. You will NOT be tested on Python this quarter, but will need to understand this file enough to write an equivalent java version.
2.Download Lab00.java. This file is incomplete and you will need to finish it. Translate the given Python file to Java. Please translate everything, including the comments!
To compile your files, type:
javac Lab00.java
To run your code, type:
java Lab00
Demo
Demonstrate your working program to your instructor. Be prepared to show your source code. Come to lab on the due day with your lab finished!
Lab courtesy of Julie Workman.