methods - Creating a constructor -


i've got code need with. i'm ap cs student (and it's introductory) please don't judge me.

// name:       //     // program:  coinstester     //     // purpose:       public class coinstester {             public static void main(string[] args) {      //create new coins object named money , pass amount of cents parameter   //***** students need complete ******       coins();        coins money = new coins();           // call correct method in coins class find answer   //***** students need complete ******         money.calculate();        }  }    // name:   // // program:  coinstester // // purpose: class accepts number of monetary change. //         output list of number of quarters, dimes, nickels, //    , pennies make amount of change least //    number of coins possible.  skeleton finished  //       students      public class coins {   //private variable store attribute of "coins" object - how many cents   //    user wants find change for.   private int mychange;   //constructor accepts initial value private data member  public coins(int change) {   mychange = change;  }        // method calculate       // 1. use modular , regular division determine quantity of each type of coin      // 2. prints quantity of coins needed make entered amount        public void calculate(){       int quarters=25, dimes=10, nickels=5, pennies=1;       int temp1, temp2, temp3, temp4;        int remainquar1, remaindime2, remainnick3, remainpenn4;           //variable declarations hold values needed different coin types         // make sure use descriptive identifiers!        //***** students need complete ******         // calculations various coin types        //***** students need complete ******         // output statements, formatted shown on specs          //***** students need complete ******        }          } 

so here thing, apologize improperly formatted code. when run it, says coins money = new coins() cannot find constructor code. need in creating proper object. thing here have create object "coinstester" tells me have no constructor linked object. can't find solutions right now. give me tips on how create constructor coinstester class?

add "method" named coinstester (if need constructor class coinstester, it's not clear q constructor need). make sure arguments correspond calling sequence, if want added explicit constructor used.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -