Session 13

Source Code

import java.util.*;

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

        // 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;
            case "E6":
                System.out.println("Example 6");
                example6();
                break;
            case "E7":
                System.out.println("Example 7");
                example7();
                break;
            default:
                System.out.println("Invalid choice");
                
        }
    }

    // example1 method
    public static void example1() {
        // Create two points


        // Display the points
        
        
    }

    // example2 method
    public static void example2() {
        // Create two points


        // Display the points
        
        
        // Swap the coordinates
        
        
        // Display the points
        

    }

    // example3 method
    public static void example3() {


    }

    // example4 method
    public static void example4() {
        

    }
    // example5 method
    public static void example5() {
        // Create coins for two players
        
        
        // Each player flips their coin
        
        
        // Show the results of the flips
        
        
        // Determine the winner
        

    }
    // example6 method
    public static void example6() {
        // Using the default constructor


    }
    // example7 method
    public static void example7() {
        // Using the parameterized constructor


    }

}

Point.java

Coin.java

Book.java

Ingredient.java

Recipe.java

MealPlan.java

Calculator.java

Last updated

Was this helpful?