Bummer! That workshop has been retired.

Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

MathQuiz.java:9: error: cannot find symbol

import java.util.*; public class MathQuiz { public static void main(String[]args) { Scanner keyboard = new Scanner(System.in); System.out.println("Which modules would you like to practice? Addition, SUbtraction, Multiplication or Division?"); String modules = keyboard.nextLine(); if(modules.equalsIgnorecase("addition ")) { Random rd = new Random(); int firstNum = rd.nextInt(101); int secNum = rd.nextInt(101); int add = firstNum + secNum; System.out.printf("What is %d + %d?",firstNum, secNum); int ansAdd = keyboard.nextInt(); if(ansAdd==add) { System.out.printf("Correct%n"); } else { System.out.printf("Incorrect%n"); } } }

}

Hi guys , i've recently tried to make a math's quiz that allows the users to choose the types of quizes between addition, subtraction , multiplication and division. I've only done up to addition so far but can;t seem to get pass the 'if' statement. What I basically did was prompt the users and ask for which type of quiz they want. and i wrote a line called modules to store the answer and use it in the 'if' statement. However when i run it , it says symbol can't be found pointing to the '.' on the if(modules.equalsIgnorecase("addition "))

If I am not mistaken your String modules isnt containing a string at all, it is simply a method for reading a string. String modules = "Which modules would you like to practice? Addition, SUbtraction, Multiplication or Division?"; should get you going in the right direction