OK. As I said I am in an intro Java class and I am having trouble typing some code.
* Write a description of class Month here.
* @author (your name)
* @version (a version number or a date)
public class Month
public static void main (String args)
String monthString = "JanFebMarAprMayJunJulAugSepOctNovDec";
Scanner myScanner = new Scanner (System.in);
System.out.print ("Enter a month: ");
int mon = myScanner.nextInt();
System.out.println ("The month is " + monthString.subset (start, end));
start = end - 1;
end = start * 3;
This is the code I am using. What I am doing is trying to get the month to display whenever you enter a number for the month in. Like entering 1 will give you an output of Jan and so on for the other months. I get an error message when I compile it on this line here:
System.out.println ("The month is " + monthString.subset (start, end)); and it says error on the variable start. Maybe something else in the code is wrong, I dunno. I do know that the start and end variables are wrong, I was trying to do this in the morning so I know I need to fix that but I need to get the above fixed first.
Maybe you can help me out like this. I just need to know how I can tell what I need to type out.
Thanks for helping.