coach2winstate
New Member
- Joined
- Jun 16, 2009
- Messages
- 2
I need help Validating the required data elements in this program. I need the Patient id,Patient last name Patient first name, Patient primary care physician, Patient address1,Patient city, Patient State, Patient zip. all validated (entered as non-spaces) If invalid data is ,entered, display an "invalid input of type .. Record reject" message and use the COUNTINUE statement to return to the top of the loop to allow a new entry to be made.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o>import java.util.Scanner;</o>
<o>public class medrecord {</o>
<o> /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner string = new Scanner (System.in);
String choice="y";
while(choice.equalsIgnoreCase("y"))
{
System.out.println("Welcome to program 1 Medical Record Program");
System.out.println(); //insert a blank line
//enter patient information
System.out.println("Patient ID?");
String id = string.nextLine();
System.out.println("Patient Last Name?");
String name = string.nextLine();</o>
<o> System.out.println("Patient First Name?");
String name2 = string.nextLine();
System.out.println("Patient Middle Name?");
String name3 = string.nextLine();</o>
<o> System.out.println("Patient Date of Birth?");
String dob = string.nextLine();
System.out.println("Patient SSN #?");
String ssn = string.nextLine();</o>
<o> System.out.println("Patient Address 1?");
String adress = string.nextLine();</o>
<o> System.out.println("Patient Address 2?");
String adress2 = string.nextLine();</o>
<o> System.out.println("Patient City?");
String city = string.nextLine();</o>
<o> System.out.println("Patient State?");
String state = string.nextLine();</o>
<o> System.out.println("Patient Zip code?");
String zip = string.nextLine();</o>
<o> System.out.println("Patient Primary Care Physician?");
String pricrphy = string.nextLine();
System.out.println("Patient primary insurance compay?");
String insur = string.nextLine();</o>
<o> System.out.println("Patient primary insurance ID?");
String insid = string.nextLine();</o>
<o> System.out.println("Patient secoundary insurance compay?");
String insur2 = string.nextLine();</o>
<o> System.out.println("Patient secoundary insurance ID?");
String insid2 = string.nextLine();</o>
<o> System.out.println("Patient next of kin emergancy contact?");
String emrcont = string.nextLine();</o>
<o> System.out.println("Patient home phone number?");
String numres = string.nextLine();</o>
<o> System.out.println("Patient work number?");
String numwrk = string.nextLine();</o>
<o> System.out.println("Patient cell phone number?");
String numcel = string.nextLine();
System.out.println(); //insert a blank line</o>
<o> System.out.println("Patient ID: " + id);
System.out.println("Last Name: " + name);
System.out.println("First Name: " + name2);
System.out.println("MI: " + name3);
System.out.println("Date Of Birth: " + dob);
System.out.println("SSN: " + ssn);
System.out.println("Address: " + adress);
System.out.println("Address 2: " + adress2);
System.out.println("City: " + city);
System.out.println("State: " + state);
System.out.println("Zip Code: " + zip);
System.out.println("Patient Primary Care Physician: " + pricrphy);
System.out.println("Patient Primary Insurance Company: " + insur);
System.out.println("Patient Primary Insurance ID: " + insid);
System.out.println("Patient Secoundary Insurance Company: " + insur2);
System.out.println("Patient Secoundary Insurance ID: " + insid2);
System.out.println("Emergancy Contact: " + emrcont);
System.out.println("Residential phone number: " + numres);
System.out.println("Work phone number: " + numwrk);
System.out.println("Cellular phone number: " + numcel);
System.out.print("Coutinue ? (y/n):");
choice=string.nextLine();
System.out.println();
}//end while</o>
<o> }// end main
}//end class</o>
<o></o>
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o>import java.util.Scanner;</o>
<o>public class medrecord {</o>
<o> /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner string = new Scanner (System.in);
String choice="y";
while(choice.equalsIgnoreCase("y"))
{
System.out.println("Welcome to program 1 Medical Record Program");
System.out.println(); //insert a blank line
//enter patient information
System.out.println("Patient ID?");
String id = string.nextLine();
System.out.println("Patient Last Name?");
String name = string.nextLine();</o>
<o> System.out.println("Patient First Name?");
String name2 = string.nextLine();
System.out.println("Patient Middle Name?");
String name3 = string.nextLine();</o>
<o> System.out.println("Patient Date of Birth?");
String dob = string.nextLine();
System.out.println("Patient SSN #?");
String ssn = string.nextLine();</o>
<o> System.out.println("Patient Address 1?");
String adress = string.nextLine();</o>
<o> System.out.println("Patient Address 2?");
String adress2 = string.nextLine();</o>
<o> System.out.println("Patient City?");
String city = string.nextLine();</o>
<o> System.out.println("Patient State?");
String state = string.nextLine();</o>
<o> System.out.println("Patient Zip code?");
String zip = string.nextLine();</o>
<o> System.out.println("Patient Primary Care Physician?");
String pricrphy = string.nextLine();
System.out.println("Patient primary insurance compay?");
String insur = string.nextLine();</o>
<o> System.out.println("Patient primary insurance ID?");
String insid = string.nextLine();</o>
<o> System.out.println("Patient secoundary insurance compay?");
String insur2 = string.nextLine();</o>
<o> System.out.println("Patient secoundary insurance ID?");
String insid2 = string.nextLine();</o>
<o> System.out.println("Patient next of kin emergancy contact?");
String emrcont = string.nextLine();</o>
<o> System.out.println("Patient home phone number?");
String numres = string.nextLine();</o>
<o> System.out.println("Patient work number?");
String numwrk = string.nextLine();</o>
<o> System.out.println("Patient cell phone number?");
String numcel = string.nextLine();
System.out.println(); //insert a blank line</o>
<o> System.out.println("Patient ID: " + id);
System.out.println("Last Name: " + name);
System.out.println("First Name: " + name2);
System.out.println("MI: " + name3);
System.out.println("Date Of Birth: " + dob);
System.out.println("SSN: " + ssn);
System.out.println("Address: " + adress);
System.out.println("Address 2: " + adress2);
System.out.println("City: " + city);
System.out.println("State: " + state);
System.out.println("Zip Code: " + zip);
System.out.println("Patient Primary Care Physician: " + pricrphy);
System.out.println("Patient Primary Insurance Company: " + insur);
System.out.println("Patient Primary Insurance ID: " + insid);
System.out.println("Patient Secoundary Insurance Company: " + insur2);
System.out.println("Patient Secoundary Insurance ID: " + insid2);
System.out.println("Emergancy Contact: " + emrcont);
System.out.println("Residential phone number: " + numres);
System.out.println("Work phone number: " + numwrk);
System.out.println("Cellular phone number: " + numcel);
System.out.print("Coutinue ? (y/n):");
choice=string.nextLine();
System.out.println();
}//end while</o>
<o> }// end main
}//end class</o>
<o></o>