Question: Write a Java program, using appropriate methods and parameter passing, that obtains from the user the following items: a person's age, the person's gender (male

 Write a Java program, using appropriate methods and parameter passing, that

Write a Java program, using appropriate methods and parameter passing, that obtains from the user the following items: a person's age, the person's gender (male or female), the person's email address, and the person's annual salary. The program should continue obtaining these details for as many people as the user wishes. As the data is obtained from the user validate the age to ensure that the value lies in the range 20 to 30 inclusive; you may assume that the user will enter whole numbers only. validate the salary to ensure that it lies in the range 40000 to 150000 inclusive; you may assume that the user will enter whole numbers only. write the data to a text file named salaries.txt in the following format: agegenderemail address:salary Note: each line of data represents one person and each data value is separated by a semicolon () Hence the data in the file that you create would look similar to: 22 male;brad@gmail.com;65000 20 female;lucy@icloud.com;72000 21 female;angela.Samson@yahoo.com.au;51000 23-female;m_king@me.com;125000 When the program terminates it should display to the screen how many of the people were male and how many were female that were written to the file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!