Problems with Java UML Class using Mutators and Accessors -


i suppose make driver called black jack , class program called card. have not made driver class yet because professor asked class program card first. teacher has said use:

teacher file of problem

above file describing use. absolutely use no arrays or array list, have not learned yet , allowed use things have learned. have asked lot of people , use arrays , dont understand why cant use them.

my code far... sorry tabs , spacings not right figure out later on.

import java.util.scanner;   public class card {  private final int max = 13; private int face, suit, points, spades, clubs, diamonds, hearts, ace, jack, queen, king; prive int randomnumber = new newcard(); //constructors  public card() { randomnumber = newcard()     }  public card(int facevalue,int suitvalue) {         //face         ace = 1;         jack = 11;         queen = 12;         king = 13;          //suit         hearts = 1;         diamonds = 2;         clubs = 3;         spades = 4;      }  //^^^^^^^ //mutators  public void setface(int face) { face = face  }  public void setsuit(int suit) { suit = suit     }   //accessors  public int getface() {     return face;}  public int getsuit() {     return suit;}  public int getpoints() {     return points;}    //^^^^^^^^^^^^^^^^^  public string tostring()     {         return "players cards " + " ";      }  } 

my problem have no idea needs done mutators have been putting face = face not working out, how suppose output tostring method because im not quiet understanding how whole face , suit thing suppose work suits hearts = 1 , faces jacks =11 thinking program confused , output wrong ones.

first try this.face = face should assignment in setface. same suit. default constructor needs use java.util.random class generate card values. getpoints should calculate cards value based on file have been given i.e. if face card = 10 etc


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -