0% found this document useful (0 votes)
995 views

CS 1102 Unit 1 Programming Assignment Solution

This Java program asks the user to input their super power through a dialog box. It then converts the input to uppercase and displays it in a message dialog box with the text "TO THE RESCUE!" to simulate the user activating their super power. The program uses JOptionPane methods to display input and output boxes to collect user input and display the results.

Uploaded by

Noura Khaddam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
995 views

CS 1102 Unit 1 Programming Assignment Solution

This Java program asks the user to input their super power through a dialog box. It then converts the input to uppercase and displays it in a message dialog box with the text "TO THE RESCUE!" to simulate the user activating their super power. The program uses JOptionPane methods to display input and output boxes to collect user input and display the results.

Uploaded by

Noura Khaddam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CS 1102 Unit 1 Programming Assignment Solution

Answer:

import javax.swing.JOptionPane;

public class SuperPower {

public static void main(String[] args) {

String power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog(null,power+" TO THE RESCUE!");


}
}

You might also like