Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by Roshni ( 8 years ago )
public class Coins {
 
 private int cent;
 private int quarter;
 private int nickel;
 private int dime;
 private int penny; 
 
 public Coins(int c)
 {
  cent=c;
  quarter= 25;
  nickel= 5;
  dime = 10;
     penny = 1;
  
     
    if (cent> 25)
     {
       quarter = cent/25;
       cent = cent%;
     }
    else
    {
 
   
    }
 }
 
 public int getQuarters()
 {
  int a= cent/quarter;
  
  return a;
 }
 
 public int getNickels()
 {
  int b = quarter*25 - dime*10/nickel;
  return b; 
 }
 
 public int getDimes()
 {
  int c= cent- quarter*25/dime;
  return c;
 
 }
 
 public int getPennies() 
 {
   int d= cent - (quarter*25) - (dime*10) - (nickel*5)/penny;
    return d;
 }
 
 
 
}

 

Revise this Paste

Your Name: Code Language: