Question: Write in .Java Output should be: John m 21 William m 28 Susan f 31 Jack m 23 Jennifer f 16 Sophia f 19 1)
John m 21 William m 28 Susan f 31 Jack m 23 Jennifer f 16 Sophia f 19


1) Prompt the user whether to display male or female student entries, ( (m) 2) Accept only" f " or " m " or " F " or " M ", otherwise, ask the user to input again. 3) Your program should read member.txt using Scanner. The file contains the name, gender and age for each individual. 4) Print name and age of students of the user's chosen gender. 7) Use printf statement (NOT println) to print out the above information to SCREEN AND to the OUTPUT FILE (output file name: Q12out.txt) 8) If the user's selection is "f"/F", use "female", if "m"/"M" use "male" to print the results. 9) Finally, your program should output the result to SCREEN AND OUTPUT FILE which includes: E) What the user searched for. F) Student name and age of the user's chosen gender. G) How many students matched the search criteria. H) The average age (data type; double) of the matching set of students. //sample log Assuming this is a sample input file Input gender (f/m):k Input again Input gender (f/m):f \begin{tabular}{|l|} \hline John m18 \\ Chloe f21 \\ Jenny f18 \\ \hline \end{tabular} List of female students name age Sample output file Chloe 21 Jenny 18 List of female students name age There are 2 female students. Chloe 21 Jenny 18 Their average age is 19.5 There are 2 female students. Their average age is 19.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
