Created
February 20, 2024 05:06
-
-
Save ehlzi/912b5b5ece8c551bdf39a6bf30a59e0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Module main(); | |
| // This module provides a simple addition math quiz | |
| Declare Integer number1, number2, userAnswer, correctAnswer; | |
| // Generate two random numbers | |
| number1 = Random(1, 100); // Random number between 1 and 100 | |
| number2 = Random(1, 100); // Random number between 1 and 100 | |
| correctAnswer = number1 + number2; // Calculate the correct answer | |
| // Display the quiz question | |
| Display "What is ", number1, " + ", number2, "?"; | |
| Input userAnswer; // Get user's answer | |
| // Check if the user's answer is correct | |
| If userAnswer = correctAnswer Then | |
| Display "Congratulations! That's the correct answer."; | |
| Else | |
| Display "Incorrect. The correct answer is ", correctAnswer; | |
| End If | |
| End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment