CSC 012N

INTRODUCTION TO COMPUTER SCIENCE


Note: Due to the change of instructors for CSC 012N, the web site for the course has moved to http://www.bernstein-plus-sons.com/.dowling/CSC012

Herbert J. Bernstein
yaya@dowling.edu


 

Instructions for Creating and Running Your Program

  1. Run your favorite editor (e.g., Ultra Edit) or word processor (e.g., Microsoft Word).  Type in the Java code.

  2. Save the program you've constructed to a text file, Filename.java.   NOTE:  Remember to name your file with the same identifier as your program or class.  That is, if your program begins:

public class MyClass
{......

then, save your program as:    MyClass.java.  If you use a word processor, be sure to save the program as a text file, NOT as a Word file.

  1. Run the MS-DOS prompt window.

  2. At the prompt, type javac followed by the filename as follows:

>javac Hello.java

This tranlates the Java source code into Java Bytecode.  That is, I have created a new file called Hello.class.

  1. Now, type java followed by the class name as follows:

>java Hello
Hello World!

The program has been executed.

Instructions for Handing in Homework

There are two ways to give me your homework assignments:

  1. (Hard Copy)
    Note: as of 6 November 2001, you should make every effort to submit assigments via email

    If you must submit hard copy, you should hand in your source code as well as your output from your program.  If you have keyboard input, you should have your program echo the input to the screen so that you can see it on output.  For example,

    x = Keyboard.readInt ("Number Please");
    System.out.println (x);    //copies the keyboard input to the screen

    To create an output file that you can print, you can invoke your program as follows:

            java Program > Program.out

    This will send the output from your program to the file Program.out instead of to the screen.  This is called "redirection" of output.   Then print both Program.java (your source code) and Program.out (your output) and hand them in.

  2. (E-Mail)
    Just send me an email message at yaya@dowling.edu including the source code file (Program.java) and output file (Program.out) as part of the text of the message, not as attachments

 

Homework Assignments


This page is based on the CSC012N course web page by Bill Steinmetz, Fall 2001. Revised by Herbert J. Bernstein, 4 November 2001.

 

Homework Assignments

To yaya's CSC012 web Page

To Bill Steinmetz Home Page