title: Java program using arrays simple coding for project
body: <p>I just want "Jan Expenditure" to appear however only expenditure comes out. How do I do it? Jan is from my monthsArrays. Is there anything missing?</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Project {
  
  static int choice;
  
  public static void main(String[] args) {
  
      {   Scanner input = new Scanner(System.in);
          System.out.println("***************Expenditure***************");
          System.out.println("1)Enter monthly expenses");
          System.out.println("2)Display detailed expenditure by month");
          System.out.println("3)Quick glance at monthly expenses");
          System.out.println("4)Exit");
          System.out.println("Please select your choice &lt;1-3&gt;:");
          choice = input.nextInt();
  
  
          switch (choice) {
          case 1:
              int count = 0;
              String[] monthsArray = { "", "Jan", "Feb", "Mar", "Apr", "May",
                      "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
              System.out.println("*******************************************");
              System.out.println("\t\t\t\t");
              System.out.print("Enter month &lt;1 for Jan - 12 for Dec&gt;:");
              int month = input.nextInt();
              for (int i=0; i &lt; monthsArray.length; i++)
              String monthChoice = monthsArray[month - 1];
              System.out.println("-------------------------------------");
              System.out.println(monthChoice + "expenditure (max 10 items)");
  </code></pre>
  
  <p>This is the output i'm getting currently</p>
  
  <p><em><strong></em>**<em>*</em>***</strong><em>Expenditure</em><strong><em>*</em>**<em>*</em>**</strong></p>
  
  <p>1)Enter monthly expenses</p>
  
  <p>2)Display detailed expenditure by month</p>
  
  <p>3)Quick glance at monthly expenses</p>
  
  <p>4)Exit</p>
  
  <p>Please select your choice &lt;1-3>: 1</p>
  
  <hr>
  
  <p>Enter month &lt;1 for Jan - 12 for Dec>:1</p>
  
  <hr>
  
  <p>expenditure (max 10 items)</p>
  
  <p>Enter item 1:   </p>
  
  <p>As you can see the array "Jan" is not appearing.</p>