Hi i am new to java and i was wondering if someone could help me with this code
Trinbago Attractions Ltd. has engaged your company, The Software Development
Company Ltd., to design and develop a software solution to replace the paper-based
system currently used to manage operational data and support business operations.
Business analysis personnel from your company have recently concluded their
investigation phase of the client organization and have produced documentation detailing
their findings inclusive of a basic analysis of stakeholder needs.
The team has provided the following:
1. There are two major users of the system, general clerical staff and attraction staff.
2. Clerical Staff can:
a. Register Customers (requires the customer’s name, age, gender, weight
and height)
b. Edit Customer Details
c. Search for Customers
d. Accept Payment
e. View Packages
3. The attraction staff can:
a. View Customer Details
b. View attraction rules and regulations
c. Scan customer passes
4. Every attraction needs to have a an algorithm that takes into consideration three
factors, in order to determine if a customer can access the attraction. These factors
are:
a. Customer Age
b. Customer Height
c. Customer Weight
5. The main attraction is called “The Blue Flipper” which requires:
a. A minimum age of 10 and a maximum age of 65
b. A minimum weight of 55 pounds and a maximum weight of 220 pounds
c. A minimum height of 3.5 feet and a maximum height of 7 feet
d. If a customer meets the height and weight requirements but is under aged
they can still go on the ride.
you are required to develop two parts of the system:
1. The customer registration to be used by the clerical staff
2. The core logic for gaining admission to “The Blue Flipper”
I've gotten this far.
import java.util.Scanner; import java.util.ArrayList; import java.util.List; public class SimpleMenu{ private static final String CREATE_PERSON_OPTION = "1"; private static final String SEARCH_PERSON_OPTION = "2"; private static final String QUIT_OPTION = "Q"; private static final int POSITION_NOT_FOUND = -1; public static void printMainMenu( Scanner console ){ System.out.println( "\nPlease enter an option:" ); System.out.println( "Enter 1 to create a person." ); System.out.println( "Enter 2 to search a person." ); System.out.println( "Enter Q to quit.\n" ); } public static void printCreatePersonMenu( Scanner console, List<String> names, List<Integer> ages ){ System.out.print( "\nPlease enter a name: " ); String name = console.next(); System.out.print( "Please enter an age: " ); Integer age = console.nextInt(); names.add( name ); ages.add( age ); } public static int findPersonPosition( String name, List<String> names ){ return POSITION_NOT_FOUND; } public static void printSearchPersonMenu( Scanner console, List<String> names, List<Integer> ages ){ System.out.print( "Please enter a name: " ); String name = console.next(); int position = findPersonPosition( name, names ); if( position == POSITION_NOT_FOUND ){ System.out.printf( "Person with name %s was not found.\n", name ); } else{ System.out.printf( "Found %s who is %d years old.\n", name, ages.get( position ) ); } } public static void handleOption( String option, Scanner console, List<String> names, List<Integer> ages ){ if( option.equals( CREATE_PERSON_OPTION ) ){ printCreatePersonMenu( console, names, ages ); } else if( option.equals( SEARCH_PERSON_OPTION ) ){ printSearchPersonMenu( console, names, ages ); } else{ System.out.println( "You entered an invalid option" ); } } public static void promptAndPrint( Scanner console, List<String> names, List<Integer> ages ){ while( true ){ printMainMenu( console ); String option = console.next(); if( option.equals( QUIT_OPTION ) ){ break; } handleOption( option, console, names, ages ); } } public static void main( String args[] ){ Scanner console = new Scanner( System.in ); List<String> names = new ArrayList<String>(); List<Integer> ages = new ArrayList<Integer>(); promptAndPrint( console, names, ages ); } }