From c72ef2d32785a0abfbc820734c41a4a46c4f57df Mon Sep 17 00:00:00 2001 From: Chamozzarella <79752316+Chamozzarella@users.noreply.github.com> Date: Fri, 4 Mar 2022 10:46:06 +0300 Subject: [PATCH 1/4] add evaluation code in main method --- .vs/ProjectSettings.json | 3 +++ .vs/VSWorkspaceState.json | 6 ++++++ .vs/cs319-spring22-git-lab/v16/.suo | Bin 0 -> 15360 bytes .vs/slnx.sqlite | Bin 0 -> 90112 bytes Main.java | 13 +++++++++++-- 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .vs/ProjectSettings.json create mode 100644 .vs/VSWorkspaceState.json create mode 100644 .vs/cs319-spring22-git-lab/v16/.suo create mode 100644 .vs/slnx.sqlite diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..6b61141 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,6 @@ +{ + "ExpandedNodes": [ + "" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/cs319-spring22-git-lab/v16/.suo b/.vs/cs319-spring22-git-lab/v16/.suo new file mode 100644 index 0000000000000000000000000000000000000000..7d6bc8d521c9074601e81ae90733fe26077ae27a GIT binary patch literal 15360 zcmeI3TW=dh6vrnm1W!+O$b;&@^e&Hb~^fv7Oe`Ni5sx1@TZ` z`2--I_yS0L1$aY<_5mRt0Kqd7LP9(t8h-!Xop`_K z+_=8=*U!J)@tX<2ezVcsT;6Q%^_92z(q@Y>Pm)*J&E@4~y;7QF3mRwyPMbyk3Z~s0 zHVZs+=BlPLGHf%OR_1)u8eiS`;^&V)+xuhNgVekBgj;zMii_rba~$e(qz;=aYqV1O zdYjp>LSMsP`nG)T6vc?I1D3w%W=)13v)&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Hax7NHp0O`Mmyto#2(CrN6R+G z*(awt%UHs@Do=MAm%+U?ey=NlCk(>kETz}cE!0z_o;pM6rP)e*Ry9*;SE**~-4!+% zO(yAkw$&0RX%D80)7*W`#M9@;xs#52h*_+;eqy?fmw$Qty;)+mqkZZnOE=HYHWFFQ zIm!~?7`I`dmTsT#M8u&N84xzPad?>$JRV}S8LvD!*QJa#r{|9cVe_Lz_H=Ba#l2}U zb*2WJAF%mxq?L{b9Df00bTx0oeb4WT@dnKmZ5;0U!VbfB+Bx0zd!=00AHX1U@$c{|{J! B=xqQ1 literal 0 HcmV?d00001 diff --git a/Main.java b/Main.java index 6054a64..267943c 100644 --- a/Main.java +++ b/Main.java @@ -1,5 +1,14 @@ public class Main { public static void main(String[] args) { - - } + NewCalculator calculator = new NewCalculator(); + // Try division + calculator.Divide(100, 12); + System.out.println(calculator.getLastResult()); + // Try addition + calculator.Add(10, 35); + System.out.println(calculator.getLastResult()); + // Try subtraction + calculator.Subtract(50, 15); + System.out.println(calculator.getLastResult()); + } } From 8b7b4c71e847da2997b90ef85ef7bf2858c544f7 Mon Sep 17 00:00:00 2001 From: Chamozzarella <79752316+Chamozzarella@users.noreply.github.com> Date: Fri, 4 Mar 2022 11:09:23 +0300 Subject: [PATCH 2/4] add multiplication feature --- .gitignore | 4 ++++ NewCalculator.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index a1c2a23..2850ba8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,7 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +.vs/ProjectSettings.json +.vs/cs319-spring22-git-lab/v16/.suo +.vs/ProjectSettings.json +.vs/cs319-spring22-git-lab/v16/.suo diff --git a/NewCalculator.java b/NewCalculator.java index 23b3783..83f9f8d 100644 --- a/NewCalculator.java +++ b/NewCalculator.java @@ -23,5 +23,10 @@ public double Divide(double dividend, double divisor){ this.lastResult = dividend % divisor; return this.lastResult; } + + public double Multiply(double x, double y){ + this.lastResult = x * y; + return this.lastResult; + } } From bc450299ca76ccefd69f758aa741a9af1eef0fc4 Mon Sep 17 00:00:00 2001 From: Chamozzarella <79752316+Chamozzarella@users.noreply.github.com> Date: Fri, 4 Mar 2022 11:10:33 +0300 Subject: [PATCH 3/4] add multiplication feature --- Main.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Main.java b/Main.java index 267943c..969b57f 100644 --- a/Main.java +++ b/Main.java @@ -10,5 +10,8 @@ public static void main(String[] args) { // Try subtraction calculator.Subtract(50, 15); System.out.println(calculator.getLastResult()); + // Try Multiplication + calculator.Multiply(10, 30); + System.out.println(calculator.getLastResult()); } } From 8ebfaf100286e5c7fb2c973c2ea494f015e27207 Mon Sep 17 00:00:00 2001 From: Kylian Date: Fri, 4 Mar 2022 11:25:47 +0300 Subject: [PATCH 4/4] add evaluation code for Multiply --- .gitignore | 54 +++++++++++++++++++------------------- Main.java | 34 ++++++++++++------------ NewCalculator.java | 64 +++++++++++++++++++++++----------------------- README.md | 4 +-- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/.gitignore b/.gitignore index 2850ba8..f208605 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,27 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -.vs/ProjectSettings.json -.vs/cs319-spring22-git-lab/v16/.suo -.vs/ProjectSettings.json -.vs/cs319-spring22-git-lab/v16/.suo +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +.vs/ProjectSettings.json +.vs/cs319-spring22-git-lab/v16/.suo +.vs/ProjectSettings.json +.vs/cs319-spring22-git-lab/v16/.suo diff --git a/Main.java b/Main.java index 969b57f..e6a37f7 100644 --- a/Main.java +++ b/Main.java @@ -1,17 +1,17 @@ -public class Main { - public static void main(String[] args) { - NewCalculator calculator = new NewCalculator(); - // Try division - calculator.Divide(100, 12); - System.out.println(calculator.getLastResult()); - // Try addition - calculator.Add(10, 35); - System.out.println(calculator.getLastResult()); - // Try subtraction - calculator.Subtract(50, 15); - System.out.println(calculator.getLastResult()); - // Try Multiplication - calculator.Multiply(10, 30); - System.out.println(calculator.getLastResult()); - } -} +public class Main { + public static void main(String[] args) { + NewCalculator calculator = new NewCalculator(); + // Try division + calculator.Divide(100, 12); + System.out.println(calculator.getLastResult()); + // Try addition + calculator.Add(10, 35); + System.out.println(calculator.getLastResult()); + // Try subtraction + calculator.Subtract(50, 15); + System.out.println(calculator.getLastResult()); + // Try Multiplication + calculator.Multiply(10, 30); + System.out.println(calculator.getLastResult()); + } +} diff --git a/NewCalculator.java b/NewCalculator.java index 83f9f8d..daa9faa 100644 --- a/NewCalculator.java +++ b/NewCalculator.java @@ -1,32 +1,32 @@ -public class NewCalculator { - private double lastResult; - - public NewCalculator(){ - this.lastResult = 0; - } - - public double getLastResult(){ - return this.lastResult; - } - - public double Add(double x, double y){ - this.lastResult = x + y; - return this.lastResult; - } - - public double Subtract (double x, double y){ - this.lastResult = x - y; - return this.lastResult; - } - - public double Divide(double dividend, double divisor){ - this.lastResult = dividend % divisor; - return this.lastResult; - } - - public double Multiply(double x, double y){ - this.lastResult = x * y; - return this.lastResult; - } - -} +public class NewCalculator { + private double lastResult; + + public NewCalculator(){ + this.lastResult = 0; + } + + public double getLastResult(){ + return this.lastResult; + } + + public double Add(double x, double y){ + this.lastResult = x + y; + return this.lastResult; + } + + public double Subtract (double x, double y){ + this.lastResult = x - y; + return this.lastResult; + } + + public double Divide(double dividend, double divisor){ + this.lastResult = dividend % divisor; + return this.lastResult; + } + + public double Multiply(double x, double y){ + this.lastResult = x * y; + return this.lastResult; + } + +} diff --git a/README.md b/README.md index aad3534..5e1bc33 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# cs319-spring22-git-lab -This is the base repository that CS 319 students will fork and work with as part of their Git lab assignment +# cs319-spring22-git-lab +This is the base repository that CS 319 students will fork and work with as part of their Git lab assignment