Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //package flashcards;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.println("Input the number of cards:");
- int leg = scanner.nextInt();
- final char dm = (char) 34;
- String [] card = new String[leg];
- String [] def = new String[leg];
- for (int i = 0; i < card.length ; i++) {
- System.out.println("The card #" + (i+1));
- card[i] = scanner.next();
- System.out.println("The definition of the card #" + (i+1));
- def[i] = scanner.next();
- }
- for (int i = 0; i < card.length ; i++) {
- System.out.println("Print the definition of " + dm + card[i].toString() + dm +":");
- if (def[i].equals(scanner.next())){
- System.out.println("Correct answer.");
- } else {
- System.out.println("Wrong answer. The correct one is " + dm + def[i].toString()+ dm + ".");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement