Practice: Subroutines

Take out a piece of paper. We’ll be programming on paper.

Write Java code for the following problems.

Problem 1

Write a public static subroutine getString that asks the user to enter a hexidecimal String. Then uses getHexValue to convert that String to an int.

Problem 2

Write a public static subroutine that calls public static int playGame(int num) and calculates the average score. The subroutine should take two int parameters num and numberOfGames. numberOfGames is the number of time to call playGame.

Show me your code before you leave