daily pastebin goal
11%
SHARE
TWEET

Donor.java

a guest Jul 12th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. class Donor
  3. {
  4.     public static void main (String [] args)
  5.     {
  6.         Scanner s = new Scanner (System.in);
  7.         System.out.println ("Enter donation amount!");
  8.         double amount = s.nextDouble();
  9.     }
  10.     public static String donor(double amount)
  11.     {
  12.         if(amount <= 10000)
  13.         {
  14.             return "Benefactor!";
  15.         }
  16.         else if(amount >= 1000 && amount < 10000)
  17.         {
  18.             return "Patrons!";
  19.         }
  20.         else if(amount >= 200 && amount < 1000)
  21.         {
  22.             return "Supporters!";
  23.         }
  24.         else if(amount >= 15 && amount < 200)
  25.         {
  26.             return "Friends!";
  27.         }
  28.         else if(amount > 15)
  29.         {
  30.             return "Cheapskates!";
  31.         }
  32.     }
  33. }
  34.  
  35. ~/workspace/pset3a/ $ javac Donor.java
  36. Donor.java:32: error: missing return statement
  37.     }
  38.     ^
  39. 1 error
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top