/**
 * Os class works as an operating system for inanimate objects like planes,
 * robots, etc.
 * CSCE 155 Fall 2005
 * Assignment 1
 * @author
 * @version
 */

// import statements
import java.io.*;

public class Os  {
    
    
    // -------------------------------------------------------------------------
    // You may add more data members to the following to describe a Os.
    // -------------------------------------------------------------------------
    
    // private data members -- variables
    private String name;   // describes the name of the object this 
                           // operating system is running on
    private int testingChoice;  // stores the user's choice of testing
                                // 1 means the user wants to test the 
                                // Navigation system and 2 means the user 
                                // wants to test the Weapon system
    
    private Navigation navigationSystem;  // stores the navigation component
    private Weapon weaponSystem;          // stores the weapon component
    
    // -------------------------------------------------------------------------
    // Here are the public and private methods that specify the fighter.
    // First of all, a fighter object will provide information for you, will
    // allow you to change its settings, and will also do quite a bit of other
    // things.  You may add new methods.
    // -------------------------------------------------------------------------
    
    /** Constructor
     *  initialize all private data members to appropriate values
     *  If you add more data members, you will have to initialize them here
     *  too.
     */
    public Os()  {
        
        navigationSystem = new Navigation();
        weaponSystem = new Weapon();
        this.testingChoice = 0;
        
    }  // end constructor
    
    
    //--------------------------------------------------------------------------
    //Please Complete the runTest method below
    //This method will run individual
    // tests on the components depending on the choice entered by the user
    //--------------------------------------------------------------------------
    public void runTest(){
        


        
        
        
    }//end of runTest
    
    
    /**
     * This method displays a welcome message to the user.
     */
    public void displayWelcome()  {
        
        /* Display a brief welcome message about the factory */
	System.out.println("Welcome to my world");
        
    }  // end displayWelcome
    
    /**
     * This method displays a goodbye message to the user.
     */
    public void displayGoodbye()  {
        
        /* Display a brief goodbye message from the factory */
        
    }  // end displayGoodbye
    
    /**
     * This method obtains the testing choice from the user.  It calls
     * readInteger() to obtain the choice.  1 means "Navigation" testing,
     * "2" means "Weapon" testing.
     * Then it stores the choice in the testingChoice variable
     * Note that this method does not return
     * anything.
     * Yet to be implemented.
     */
    public void obtainTestingChoice()  {
        
        // 1.  Prompt the user to enter a number.
        // 2.  Call "readInteger()" to get the number.
        // 3.  Then store the integer in the testingChoice variable
        //
    }  // end obtainTestingChoice
    
    /**
     * This method reads in a string and converts the string into an integer and
     * returns that integer to the caller of this method.
     */
    
    private int readInteger()  {
        
        String userInput = "";
        int temp = 0;
        
        BufferedReader stdin =
                new BufferedReader(new InputStreamReader(System.in), 1);
        
        try {
            userInput = stdin.readLine();
            temp = Integer.parseInt(userInput);  // convert to integer
        }  catch (IOException ex) {
            System.out.println(ex);
        }
        
        return temp;
        
    }  // end readInteger
    
    /**
     * This method reads in a string and returns that string to the caller of
     * this method.
     */
    
    private String readString()  {
        
        String userInput = "";
        
        BufferedReader stdin =
                new BufferedReader(new InputStreamReader(System.in), 1);
        try {
            userInput = stdin.readLine();
        }  catch (IOException ex) {
            System.out.println(ex);
        }
        
        return userInput;
        
    }  // end readString

    /**
     * This main method creates an object of the Os class and runs
     * the Os. 
     *
     * First, it asks the Os object to display a welcome message.  Then it asks
     * the object to obtain testing choice from the user.  Next, it asks the Os
     * object to run the test accordingly.  Finally, it asks the Os object to
     * display a goodbye message.
     *
     */

    public static void main(String[] args)  {

       Os mySystem = new Os();
       mySystem.displayWelcome();
       mySystem.obtainTestingChoice();
       mySystem.runTest();
       mySystem.displayGoodbye();
                                     
    }  // end main

    
}  // end Class Os

