CS 342 Lab 1: Moving from Java to C++

Note: Only use Lab 1 if you have completed CS 241, and if you did not use C++ in your CS 241 labs. If you have not completed CS 241, or you used C++ in your CS 241 labs, then use the Alternate Lab 1.

CS 342 Lab 1: Moving from Java to C++

Lab date: 18 January through 20 January 2000
Due date: 23 January 2000 11:59 pm


This lab shows the obvious differences between Java and C++. And, it ensures that you are comfortable using the tools for compiling C++ programs. Finally, it introduces some elementary C++ language features.


Obtaining the Lab distribution:

At a Unix shell prompt, type ~cs342/bin/lab1. That will copy several files to a new lab1 subdirectory. You don't need the java (they are used for the Alternate Lab 1, so you can remove them). Then, copy over your CS 241 Lab 2 or Lab 3 files.

NOTE: If you're a CEC Unix machine, you must pkgadd java_1.2. (Or maybe java2, but we haven't tested it yet.)


  1. Translate your CS 241 Lab 2 (Dictionary) or Lab 3 (Skip List) from Java to C++. The goal is to gain some familiarity with C++. So, if you find it helpful to simplify your CS 241 implementation a bit, that's OK.

  2. Put your test output in these files:
    1. out.java for the Java Skip List implementation.

    2. out.c++ for your C++ implementation.

    You can use the shell redirection operator to put output into a file, e.g.,
    java skiplist > out.java

What to Submit:

CS 342 home page