title: A stock market investor simulation
body: <p>I have to write a program that simulates an investor buying and selling shares in a stock market. The investor needs tools to display his portfolio and buy and sell shares. Shares value can go up and down so un underlying simulation of the market should be implemented.</p>
  
  <p>There are 7 levels all must be done in stages:</p>
  
  <p>Level 1 –Includes screen output and keyboard input and basic classes.
  There are java source files for at least three major classes in the program.
  Good source comments and code indentation is expected for all implemented parts of the code</p>
  
  <p>Example: The program reads and prints the names of shares and their basic characteristics.</p>
  
  <p>Level 2 – Includes methods and variables for at least three major classes, and all constructions above.</p>
  
  <p>At least 3 major methods fully implemented and working for each class
  Example: As above, but also the notion of the buying and sell shares is shown.</p>
  
  <p>Level 3 – At least three major program classes will be implemented, with methods working and well designed,and all constructions above
  Use of inheritance with at least one superclass and three subclasses
  Class, method and variable naming will be clear and consistent</p>
  
  <p>Example: As above, but also there is a basic simulation of the stock market, though most details, commentary etc. may be very simple</p>
  
  <p>Level 4 –Polymorphism should be used in at least three subclasses, and all constructions above</p>
  
  <p>At least four major program classes will be implemented, with methods working and well designed,Comments are clear and applied to class and method level consistently</p>
  
  <p>Example: As above, but the simulation is more natural, there is a running commentary of the change in value of the
  shares with major events reported.</p>
  
  <p>Level 5 –Use of ArrayLists or other classes from Java’s Collection Framework in all parts of the program, and all constructions above.Exception handling is carried out appropriately in all parts of the program Inheritance is correctly applied to all parts of the program.</p>
  
  <p>Example: As above, but all types of accounts and functionality will now be included in the simulation. The simulation is now mostly ruled by a basic GUI.</p>
  
  <p>Level 6 – Includes file input and/or output, and all constructions above
  The simulation (including player movement) will be displayed on the GUI Polymorphism will be fully implemented in all parts of the program</p>
  
  <p>Example: As above, with a full GUI now controlling all aspects of the simulation; data should be read from files.</p>
  
  <p>Level 7 – Includes everything required for an A grade but also something special (using other more advanced constructs or algorithms,
  or something you just read up on yourself). Make it a program someone would really want to use!</p>
  
  <p>Example: .. real historical data, moving averages,...</p>
  
  <p>This is my code the error I get is array not found for the shares part:</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  import java.util.Arrays;
  
  public class StockMarketInvestor
  {
  
      public StockMarketInvestor()
      {
  
      }
  
      public static void main(String[]args)
      {
          String name;
          int numberShares;
          double buyPrice,sellPrice;
          create String; array
  
          String[] shares = new String[]{"ARM", "IBM", "Google", "Facebook", "Twitter", "Samsung", "Lenovo", "Intel"};
  
          ArrayList list = (ArrayList) Arrays.asList(shares);
  
          System.out.println("String array converted to List");
  
          for(int i=0; i &lt; list.size(); i++)
          {
              System.out.println(list.get(i));
          }
  
          Scanner input = new Scanner(System.in);
          System.out.print("Which share would you like to purchase?");
          name=input.nextLine();
  
          System.out.print("How many shares bought?");
          numberShares=input.nextInt();
          System.out.print("Buy price?");
          buyPrice=input.nextDouble();       
          System.out.print("Sale price?");
          sellPrice=input.nextDouble();        
          input.close();       
  
          System.out.println(name + "here is the information of your stock transactions:");
          System.out.println("Number of shares:" + numberShares);        
          System.out.println("Amount of purchase:" + buyPrice*numberShares);      
          System.out.println("Amount of sell:" + sellPrice*numberShares);      
          System.out.println("Transaction fee paid:" + 15 + 15);
          System.out.println("Net profit:" + (sellPrice*numberShares-buyPrice));
  
      }
  
  }
  </code></pre>
  
  <p>Any advice would be appreciated.</p>