Generation

generate functionSun, 16 Apr 2023

Creame un cuestionario con interfaz gráfica

import javax.swing.*; import javax.swing.JOptionPane; import java.awt.*; public class Quiz { public static void main(String[] args) { String question1 = JOptionPane.showInputDialog("What is the best programming language?"); if (question1.equals("Java")) { JOptionPane.showMessageDialog(null, "Correct!"); } else { JOptionPane.showMessageDialog(null, "Wrong!"); } String question2 = JOptionPane.showInputDialog("What is the best food?"); if (question2.equals("chocolate")) { JOptionPane.showMessageDialog(null, "Correct!"); } else { JOptionPane.showMessageDialog(null, "Wrong!"); } String question3 = JOptionPane.showInputDialog("What is the best sport?"); if (question3.equals("programming")) { JOptionP

Want to kickstart your project?Use the new AI Studio to create your code