The program below is the answer to Liang’s Introduction to Java Programming (9th Edition) Chapter 3 Exercise 3.1.

Sample Program runClick…