+ 1

how do i write a code that asks the user to input his months salaries and stores them in an array

28th Dec 2017, 12:09 AM
Tasha
10 Antworten
+ 3
use a loop using cin and an index for the Array while taking in either a fixed amount based on the iterator or parsing input for a character to exit the loop.
28th Dec 2017, 12:44 AM
Michael Simnitt
Michael Simnitt - avatar
+ 2
to give a more defined answer a better definition of the problem would help
29th Dec 2017, 9:07 AM
Michael Simnitt
Michael Simnitt - avatar
+ 2
are you trying to input it from an input field or from an input prompt?
29th Dec 2017, 9:12 AM
Michael Simnitt
Michael Simnitt - avatar
+ 2
sorry I haven't taken the time to learn Java yet
29th Dec 2017, 9:18 AM
Michael Simnitt
Michael Simnitt - avatar
+ 1
Michael I am having the same challenge, pls explain your answer better
29th Dec 2017, 9:06 AM
Anthony
Anthony - avatar
0
how do I get user input and store it in an array. I tried using.... import java.util.Scanner ..Scanner myScan = new Scanner. put it didn't work.
29th Dec 2017, 9:11 AM
Anthony
Anthony - avatar
0
java scanner
29th Dec 2017, 9:17 AM
Anthony
Anthony - avatar
0
input prompt
29th Dec 2017, 9:18 AM
Anthony
Anthony - avatar
0
OK Michael. Gordie I mean Java (scanner)
29th Dec 2017, 9:20 AM
Anthony
Anthony - avatar
0
OK thanks
29th Dec 2017, 3:24 PM
Anthony
Anthony - avatar