Session 24

Source Code

import java.util.*;

public class Session24 {
    public static void main(String[] args) {
        System.out.println("Session 24");

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

        // 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;
            default:
                System.out.println("Invalid choice");
        }
    }

    // example1 method
    public static void example1() {
        

        // Get a reference to the current song
        

        // Modify the song
        

        // The song inside MusicPlayer is affected
        
    }

    // example2 method
    public static void example2() {
        

        // Modify the returned object directly
        

    }

    // example3 method
    public static void example3() {
        
    }

    // example4 method
    public static void example4() {
        
    }

    // example5 method
    public static void example5() {
        // isPrime
        

        // fibonacci
       

        // gcd
      

    }
}

Song.java

MusicPlayer.java

CityBankAccount.java

CityBankCustomer.java

CityBankDemo.java

User.java

MathUtilities.java

Dealership.java

Last updated

Was this helpful?