Create Java Class File Named Paycalculatorjava Main Method Add Following Methods Class Pub Q37297842

Create a Java Class file named PayCalculator.java with a main()method. Add the following methods to your class:

  1. public static String getName() { } prompts the user for theirname using JOptionPane.showInputDialog() and returns the name.
    • You will call this method from main() and “catch” the returnedString variable. For debugging purposes, print the name to theconsole using the method System.out.println()
  2. public static double getHours() { } prompts the user for thenumber of hours worked using JOptionPane.showInputDialog(),converts the value to a number, and returns the hours worked.
    • You will call this method from main() and “catch” the returneddouble variable. For debugging purposes, print the hours
      OR
      OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.