ComputerVirus - /* An instance of class ComputerVirus...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** An instance of class ComputerVirus represents a single computer virus. * It has several fields that one might use to describe a computer virus, * as well as methods that operate on these fields.*/ public class ComputerVirus { private String name; private char type; private int monthofDiscovery; private int idNumber; private int yearofDiscovery; private ComputerVirus predecessor; private int numberofVariations; /**Constructor: a new ComputerVirus. Parameters are, in order, the name of * the virus, the month and year of discovery, and what type of processor it infects. * The virus has no id number, its predecessor is not known, and it has no known * variations. Precondition: the month is in the range 1. .12, and the type of * processor is 'W' (windows), 'M' (Mac), or 'L' (Linux).*/ public ComputerVirus(String name, int month, int year, char type){ name=name; monthofDiscovery=month; yearofDiscovery=year; type=type; int idnumber; idNumber=-1; } /**Constructor: a new ComputerVirus. Parameters are, in order, the name of the virus,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

ComputerVirus - /* An instance of class ComputerVirus...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online