specification :
specification A printer uses a sheet of paper and a unit of toner every time a copy is made.
A new toner cartridge has 4000 units of toner. When paper is added, the drawer must be filled to 500 sheets.
No copy can be made if the paper or the toner has run out.
The printer display shows paper and toner left after every copy, new cartridge or paper fill as well as the total copies so far.
A new printer is empty.
Slide 3:
printer printCopy
1: if there is toner and paper
2: decrement toner
3: decrement sheets
4: increment copies
5: end if
6: display
New version :
New version A new version of the printer is able to print on both sides of the sheet. A double copy uses one sheet of paper but two units of toner.
Testing :
Testing Plan and make a test table.
Your test should show that the printer can print single side and double side.
The printer display is accurate after any copy and replacing paper or toner.
The printer must only copy if there is toner and paper.
Sample internal commentary :
Sample internal commentary // Programmer: Ann O'Nymus
// Date: 1/1/2001
// Car Park
public class carPark
{
// stores number of spaces currently in the carpark
private int spaces;
//constructor method, car park starts with 10 spaces
public carPark()
{
spaces = 10;
reportSpaces();
}