Question
Please write with java 1-) Ask the user for how many patients you want to enter information. 2-) In the first step, when entered 3
Please write with java
1-) Ask the user for how many patients you want to enter information. 2-) In the first step, when entered 3 for example, your program should ask the user to enter the demographic information of patients 3 times. 3-) For each patient, give a user to enter patient information from the screen. Your program should ask the user to enter the first name. The first name should only consist of letters. If it contains anything else such as a number, then the program should warn that user and allow him/her to re-enter it using the right format. Your program should ask the user to enter the last name. The last name should only consist of letters. If it contains anything else such as a number, then the program should warn that user and allow him/her to re-enter it using the right format. Your program should ask the user to enter the age. Remember, an age cannot be negative and cannot contain any letter(s) either. So, your program should check out these conditions and warn the user to re-enter input. Your program should ask the user to enter the gender. You should provide the gender information as either Male or Female to the user. If the user enters information other than these two options, then the program should warn that user and allow him/her to re-enter it using the right option (Male or Female). Your program should ask the user to enter the race. The race information should include White, African-American, Asian, American-Indian, and Other options. If the user enters data other than these four options, then the program should warn that user and allow him/her to re-enter it using the right option (White, African-American, Asian, American-Indian, Other).
4-) After entering all demographic information, your program should display all information for each patient on the screen. It is up to you how you want to format your output but it should be readable and understandable. Tips: You should use descriptive variable names, error checks, decision structures, repetitive structures (nested loops), functions, and appropriate data structures (arrays, array lists, etc.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started