American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Intro To Java – Alex Lee

March 3, 2023 @ 5:00 pm - 6:00 pm

Homework
  1. Create a new project called Mar3Magic8Ball.java, and use a combination of Random module, while loop, if else statements to create Magic8Ball game.
  2. Look at below Python codes for your reference
      1. import random
        
        while True: 
            user_question = input("\nEnter your question? ")
            if user_question.lower() == "quit" or user_question.lower() == "exit": 
                print("Bye bye")
                break
            random_num = random.randint(1, 8)
            if random_num == 1:
                print("It is certain") 
            elif random_num == 2:
                print("Most likely.") 
            elif random_num == 3:
                print("Signs point to yes.") 
            elif random_num == 4:
                print("I don’t think so.") 
            elif random_num == 5:
                print("Ask again later.") 
            elif random_num == 6:
                print("Concentrate and ask again.") 
            elif random_num == 7:
                print("Outlook not so good.") 
            elif random_num == 8:
                print("My reply is no")

Details

Date:
March 3, 2023
Time:
5:00 pm - 6:00 pm
Event Categories:
,
Verified by MonsterInsights