Id - /* * Jesus Campos * CS-116-004 * Final Project - Id...

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

View Full Document Right Arrow Icon
/** * Jesus Campos * CS-116-004 * Final Project - Id Class * The Id class is used to create an Id object in the Structure class. This is because the ID field needs * to be 3 characters and 8 digits. This makes it a standard format for the ID field and ensures that a * valid value is present for the ID of a structure. **/ package code2; p public class Id { //the Id is made up of two part: a string of three letter and eight digits put all together e String letters; int numbers; String theId = letters+numbers; S public Id() { letters = "ABC"; numbers = 12345678; theId = letters+numbers; } public Id(String anId) { theId = anId; } public Id(String num, int letrs) { theId = num+letrs; } public String toString() // the toString method return both characters and digits as one single string { return theId; } /** *The ID is validated in this method. An array of all possible characters and another array of all possible digits are created two flags; one for the character and one for the digits are initialized to
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 / 2

Id - /* * Jesus Campos * CS-116-004 * Final Project - Id...

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