This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Calling a static method.  Help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Calling a static method.  Help!" Watch "Calling a static method.  Help!" New topic

Calling a static method. Help!

Ryan Newcombe

Joined: Oct 02, 2002
Posts: 24
This is part of my homework assignment that I have been stuck on for a couple hours. According to my instructions this is how it should be but I keep getting errors. Please help.

double pct = percent(possible); // USE 'PERCENT' METHOD TO CALCULATE PERCENTAGE
System.out.println("Percent: " + pct);
System.out.println("Grade: " + Other.grade(percent)); // USE 'GRADE' METHOD TO GET LETTER GRADE
public static double percent(double score, int possible) {
if (possible > 0)
return 100 * (score / possible);
return 0;
class Other {
public static char grade(double percent) {
Ryan Newcombe

Joined: Oct 02, 2002
Posts: 24
I got it! Sorry to bother you folks!
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
> I keep getting errors.

What are the errors? Pls copy and paste them here.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Calling a static method. Help!
It's not a secret anymore!