Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

l * * factorial method. A . Requirements Please write a Java program named as DemoYourLastName, so that it runs as follows: As the figure

l**factorial method. A. Requirements
Please write a Java program named as DemoYourLastName, so that it runs as follows:
As the figure below, it requests the user to enter his/her name via a pop-up window.?
Enter your name:
John Smith
javac D\epsilonjava DemoAN
javac DemoAN.java
java DemoAN
java DemoAN
After the user provides his/her name and click OK button, the program requests the
user to provide his/her income as follows via a pop-up window:java DemoAN
javac DemoAN.java
java DemoAN
java DemoANAfter the user provides the income and clicks OK button, the program outputs
information as follows via a pop-up window: java
javac DemoAN. java
.java DemoAN
javac DemoAN.java
java DemoAN
B. Submissions
Your program (DemoYourLastNameijava)[80 marks]
Screenshots to show all the 3 steps [20 marks]
*8
public class FactorialDemo
{{ int number; // To hold a number input = JOptionPane.showInputDialog("Enter a "+ number = Integer,parseInt(input); JOptionPane. showMessageDialog(null, System.exit(0);l** the factorial of its argument, which is assumed Bparam n The number to use in the calculation.*/{ return 1; // Dase case return n * factorial(n -1);}
image text in transcribed

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

Recommended Textbook for

More Books

Students also viewed these Databases questions