CSC 115 Lab#1 Exercise Solution
Requirements and steps
(1) Create a simple java source code file, called Sample.java
• Do not duplicate the demo code done in the lab.
(2) Submit it through conneX.
• All of the necessary steps will be done during your regularly scheduled lab this upcoming week.
• The lab instructor and your fellow students will be helping everyone to accomplish this task.
The source code will be assessed by a program which will look for the following:
• The single java file compiles as a Java file.
• It must contain at least 2 constructors, 2 data fields, a toString method and a main method.
• The keyword static is only used in relation to the main method.
• The running code produces at least 3 lines of output.
The assessment script will give a Pass or Fail depending on the results. Note that a Pass is not an indication that everything is perfect, the intention is to reward effort, and give enough feedback so you can seek guidance if you see that you can benefit from it.
This exercise is meant to get you through the creation, compilation and testing of a basic class file in Java. We understand that you may not have had any experience with Java or Object-oriented programming, so this is basically a no-stress introduction to get you started. We also want you to experience the process for handing in assignments, which are handled in a similar fashion.