• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calling a static method. Help!

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
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);
else
return 0;
}
}
class Other {
public static char grade(double percent) {
 
Ryan Newcombe
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it! Sorry to bother you folks!
Thanks
Ryan
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> I keep getting errors.

What are the errors? Pls copy and paste them here.
 
reply
    Bookmark Topic Watch Topic
  • New Topic