How to capture user input and store

Capture the user input of number of footballers in variable n. Use a for() loop with variable i as the counter to capture information for each staff. In each loop, ask user to input footballer’s name into variable name, footballer’s club into variable club, number of goals into variable goals and division (1 = division one or 2 = division two) into variable division. If any other input is given, display an error message and decrease the value of counter i to recollect information for that particular loop.


p/s : i don't have any idea how to do this. Can anyone help?

i don't have any idea how to do this.


Sure you do. Just take it in smaller steps.

The way the problem is worded... it's actually very easy to break this into individual steps. Each sentence is basically a step. Just do them one at a time.

Start with this:

Capture the user input of number of footballers in variable n.


You know how to do that, right? Let's see the code for it.
You know how to do that, right?


well im not sure how to break it down into individual steps. Mind to teach me?
Well this is one individual step:

Capture the user input of number of footballers in variable n.


Doing this is basically 1 line of code. So let's start with that.

(EDIT: maybe 2 lines)
Last edited on
So let's start with that.


teach me the way because i wish to learn. :) teach me how to break this statement into one single line of code. :)
I'm not going to write the code for you. If this is an assignment for a class, you should have covered how to capture user input already. Let's see you come up with the code on your own.

Once you show me you can make the effort, I'll help you along.
Disch


im working on the code right now. Once finish i will show you. :)
I'm probably going to go to bed soon (it's 1:20 AM by me). So I probably won't respond right away.
Disch


After a some revision from google source, i finally manage to do it. Thank you my friend.
Topic archived. No new replies allowed.