Source Code

Session7.java

import java.util.*;

public class Session7 {
    public static void main(String[] args) {
        String myName = ""; // add your name
        System.out.println("Session 7" + " - " + myName);

        // Menu
        System.out.println("Menu");
        System.out.println("E1 - Example 1");
        System.out.println("Q  - Quit");

        // setup Scanner
        Scanner in = new Scanner(System.in);
        System.out.print("Choice: ");
        String choice = in.nextLine();

        // switch choices
        switch (choice) {
            case "E1":
                System.out.println("Example 1");
                example1();
                break;
            case "E2":
                System.out.println("Example 2");
                example2();
                break;
            case "E3":
                System.out.println("Example 3");
                example3();
                break;
            case "E4":
                System.out.println("Example 4");
                example4();
                break;
            case "E5":
                System.out.println("Example 5");
                example5();
                break;
            case "E6":
                System.out.println("Example 6");
                example6();
                break;
            case "E7":
                System.out.println("Example 7");
                example7();
                break;
            case "E8":
                System.out.println("Example 8");
                example8();
                break;
            case "Q":
                System.out.println("Quitting..!");
                break;
            default:
                System.out.println("Invalid Choice");
        }
    }

    // example1 method
    public static void example1() {
        // create counter object
        
        // increment counter
        
        // print counter value
        
        // reset counter value
        
        // click twice and print the value
        

    }

    // example2 method
    public static void example2() {
        // create dice object
        
        // print the string representation of the object
        
        // call the roll method
        
        // print the string representation of the object
        
        // call the roll method
        
        // print the string representation of the object
        
        // getFaceValue example
        
        
    }

    // example3 method
    public static void example3() {
        // create new person object
        
        // call sayHello method

    }

    // example4 method
    public static void example4() {
        // create new person object
        
        // call sayHello method
        
        
    }

    // example5 method
    public static void example5() {
        // create new object sam
        
        // print sam
        
        // deposit $100
        
        // withdraw $50
        
        

    }

    // example6 method
    public static void example6() {
        // create a new object teddi
        
        // print teddi
        
        // deposit $500
        
        

    }

    // example7 method
    public static void example7() {
        // create a new object devin
        
        // withdraw $250

    }

    // example8 method
    public static void example8() {
        // create a new object jada


    }
    
}

Counter.java

Dice.java

Person.java

BankAccount.java

Last updated