Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program implements a flash card to teach multiplication. Put a copy of WidgetViewer.java in your src folder, where your FlashCard program is located. Write

This program implements a flash card to teach multiplication. Put a copy of WidgetViewer.java in your src folder, where your FlashCard program is located.

Write a program that uses a WidgetViewer object (the WidgetViewerer class is available elsewhere in this Lesson).

  • your program should use a Random object to generate two random numbers between 0 and 9 (inclusive).

To explain the operation of this program, we'll assume that our random number generator generated 6 and 3.

  • display a JLabel with the text "What is 6 times 3?"
  • create an empty JTextField to hold the user's answer
  • create a JButton that has the text "click after answering"
  • The user should put his or her guess in the JTextField and click the JButton.
  • When the button is clicked, the program should get the text from the JTextField, convert it from String to int, and create a JLabel that says either
    • That's right. Good Job, or
    • Sorry, the correct answer is 18

depending on whether the user input the correct number (18 in this case).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions