CJCoding With Joseph

Percentage Method

Write a method percent(int part, int whole) that returns what percentage part is of whole, as a double. Use part * 100.0 / whole. Call it with 1 and 4 and print the result:

25.0

Use System.out.println.

Expected Output:

25.0
Topics:
Methods
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.