How do I save a input String into a textfile with output messages?
Im trying to get 4 strings on terminal as output where you have to input
text and that text will be saved in a .txt file, but what happens is that
the strings which are supposed to output on terminal gets inputted in the
txt file. Here is my code
import easyIO.*;
class Birds {
public static void main(String[] args) {
In press = new In();
Out birds = new Out("birdfile.txt", true);
birds.out("Birds name: ");
String biName = press.inLine();
birds.out("Sex: ");
String biSex = press.inLine();
birds.out("Place for observation: ");
String plObs = press.inLine();
birds.out("Date of observation: ");
int date = press.inInt();
birds.close();
}
}
Does anyone know how i can get the Strings Birds name, Sex, Place for
observation, Date of observation as output on terminal then what you input
in the output gets saved in the textfile?
Because now the output messages gets saved in the textfile.
Not sure what i'm doing wrong here.
Thanks alot for help!
No comments:
Post a Comment