Sunday, September 9, 2007

Week 2 : 09/04/07 to 09/10/07 ( 1 hr )

The following example illustrates the artifacts that needs to be created in Web-CAT to create an assignment. The homework assignment in question has been taken from

http://www.horstmann.com/sjsu/cs46a/hw6.html

Exercise 7.10 Factoring of integers. Write a program that asks the user for an integer and then prints out all its factors in increasing order. For example, when the user enters 150, the program should print
2
3
5
5
Use a class FactorGenerator with a constructor FactorGenerator(int numberToFactor) and methods nextFactor and hasMoreFactors .
This class generates all the factors of a number.

public class FactorGenerator
{
/**
Creates a FactorGenerator object used to determine the factor of
an input value.
@param aNum is the input value
*/
public FactorGenerator(int aNum)
{
// TODO
}
/**
Determine whether or not there are more factors.
@return true there are more factors
*/
public boolean hasMoreFactors()
{
// TODO
}
/**
Calculate the next factor of a value.
@return factor the next factor
*/
public int nextFactor()
{
// TODO
}
// TODO: instance fields
}

1. The first step is to create an assignment for the particular course offering.


















2. For this assignment, the instructor has to upload a reference JUnit test file which is name
as FactorGeneratorTest.java. This JUnit test file will be executed whenever a students submits a solution for this assignment.

This test file needs to be targeted to a directory which is accessible by the web-server.


This configuration step is specific to an assignment and is part of several steps to configure the JavaTdd plugin that has been deployed to Web-CAT.





















3. There are other configurable options that may need to be set depending on specific requirements of the assignment.

No comments: