I Need help with solveing a java problem :)
Hey guys i need help with this I have lost some if not all of my notes from class.
I was given this task to do and im lost without my notes could someone help me with this problem. I know its a bit much for my second post but il be a regular on this forum trying to understand java ive listed the problem below any help will be appreciated :D
The program will take user input from 20 people. It will run through a survey asking the same questions for each person starting at person 1 through to 20
1. Output a message to the output screen asking the user to input their favourite hobbies ,music genre , drink ,political party
2. On a newline output to the screen a list of 5 hobbies (for example) numbered 1 – 5.
E.g. 1. Running, 2. Reading, 3. Resting, and so on.
3. On another new line send a message to the screen asking the user to input the number of their favourite hobby (a number between 1 and 5).
4. Take the user input, which is the number of their favourite hobby, and store it in a variable, e.g., favHobby.
5. Based on the number they entered, record the number of people who like each of the 5 hobbies (E.g., Set up and initialise variables for each of the hobby at the start of the program. If the hobby entered is ‘1’, add 1 to Running. If the hobby entered is ‘2’, then add 1 to Reading and so on). If any other number is entered then give a message to the screen that they have entered an invalid number.
Once all 1-20 people have inputted their favourite subject:
1. Output a message to the screen saying, for example, ‘the number of people who like Running are
2. On a new line output to the screen the (integer) number of the people who liked Running.
3. Repeat steps 1 and 2 for all hobbies.
4. Now check if the number of people who liked Running is greater than half the people tested (which is 11 out of a class of 20), then give a message to the screen saying that the students love Running. Otherwise, give a message to the screen saying that the people don’t like Running. Repeat for each hobby