diff options
author | RossTheRoss <msattr@gmail.com> | 2019-10-04 10:46:22 -0500 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-10-04 10:46:22 -0500 |
commit | ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e (patch) | |
tree | 8d256e7db4a919742edb683368deed187149b6e9 /csci1913 | |
parent | Start lab (diff) | |
download | homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.tar homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.tar.gz homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.tar.bz2 homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.tar.lz homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.tar.xz homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.tar.zst homework-ae2b8392e22a93c43fa804aa0f68e13d21cd4b1e.zip |
Lab is done but it looks not good
Diffstat (limited to '')
-rw-r--r-- | csci1913/Java/Driver.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/csci1913/Java/Driver.java b/csci1913/Java/Driver.java index 2f96b1b..de3f2f6 100644 --- a/csci1913/Java/Driver.java +++ b/csci1913/Java/Driver.java @@ -4,7 +4,39 @@ // These tests are worth a total of 25 points. class Zillion { - + private int s; + private int[] number; + public Zillion(int size) { + number = new int[size]; + s = size; + } + public void increment(){ + int n = 0; + boolean isCorrect = false; + while (isCorrect==false) { + number[n]+=1; + if (number[n] >= 10) { + number[n]=0; + if (n<(s-1)) { + n+=1; + } + else { + isCorrect = true; + } + } + else { + isCorrect=true; + } + } + + } + public String toString(){ + String test = ""; + for (int n=(s-1); n>=0; n-=1) { + test+=number[n]; + } + return test; + } } class Driver |