CSC 216/s08/own career: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 34: Line 34:


<blockquote style="border: 1px solid black; padding: 6pt; line-spacing: 140%; background-color: #D8BFD8;"><tt>
<blockquote style="border: 1px solid black; padding: 6pt; line-spacing: 140%; background-color: #D8BFD8;"><tt>
<code>
<pre>
<b>public void</b> testAdd() {
<b>public void</b> testAdd() {
Operations Calculation = <b>new</b> Operations(2, 2);
Operations Calculation = <b>new</b> Operations(2, 2);
Line 44: Line 44:
<i>assertEquals</i>(Calculation.add(),3);
<i>assertEquals</i>(Calculation.add(),3);
}
}
</code>
</pre>
</tt></blockquote>
</tt></blockquote>



Revision as of 01:45, 27 March 2008

Formatting Conventions

Java Code will look like this.

PseudoCode will look like this.

Commands will look like this.

Tip: Tips will look like this.

A string of menu commands will be marked as follows:
File => Save As

A string of keys will be marked as follows:
[Ctrl]+[Alt]+[Delete]

Instructive Graphics Will appear as follows:

http://d-site.net/stuff/java-wiki/java_logo.gif

Using Eclipse with JUnit for WebCAT

This activity will guide you through basic usage of the Eclipse IDE and JUnit for use with Webcat. Please have a computer available on which you may install Eclipse IDE. Also, please note that the following conventions will be used to draw attention to different parts of the article.

The problem

WebCAT is an software developed by Virginia Tech that allows you to submit your Java programs and have them graded in near-real-time. WebCAT tests your programs using something called JUnit. Eclipse is well integrated with JUnit, and provides an easy to use interface for evaluating your programs with JUnit. The challenge for this activity is to build a simple calculator that would pass the tests on WebCAT which would check the calculator using the following JUnit test cases:

<b>public void</b> testAdd() {
		Operations Calculation = <b>new</b> Operations(2, 2);
		<i>assertEquals</i>(Calculation.add(),4);
	}
	
	<b>public void</b> testAddNegative() {
		Operations Calculation = <b>new</b> Operations(5, -2);
		<i>assertEquals</i>(Calculation.add(),3);
	}

Participants and props

How many students will participate? What else do you need (e.g., old tennis ball, Powerpoint slides, software).

The script

Describe how to do your exercise.

Images

Images Below: