Couple hopefully simple things.
Hi guys, been doing my assignment for a long time now and really come on doing it. I basically have to read in information from a file and do different things to it. I have created a variable size array using loops - made it print out the first 20 results using loops, my current issue is:
To promt the teacher to move onto the next task:
Scanner scan2 = new Scanner(System.in);
yorn = scan2.next();
if (yorn == "n")
System.out.println("No selected, program terminating");
yorn is set a String but doesnt seem to recognise it at all. The promt shows but seems to execute the else statement no matter what.
Secondly (The most frustrating for me) is i am using similar code to manipulate the array to print out every other line in capital letters. I've come up with this in the else statement:
while ((count < 20)&&(count % 2 == 0))
The problem it it only prints the first line. I really hope that this is simple because it makes sense to me and compiles. Maybe something small.
SOrry about the abundance of text and bombarding you guys with something so trivial!