diff options
author | RossTheRoss <mstrapp@protonmail.com> | 2019-10-16 14:56:08 -0500 |
---|---|---|
committer | RossTheRoss <mstrapp@protonmail.com> | 2019-10-16 14:56:08 -0500 |
commit | 4e15412bd6bbc53bf60dadd1587fff93de2c83b7 (patch) | |
tree | 88e79634f953e9cb62c81599bc646e35abe7435f /csci1913/Java/lab6/tests6.java | |
parent | Move things around (diff) | |
download | homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.tar homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.tar.gz homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.tar.bz2 homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.tar.lz homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.tar.xz homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.tar.zst homework-4e15412bd6bbc53bf60dadd1587fff93de2c83b7.zip |
Finish lab
Diffstat (limited to 'csci1913/Java/lab6/tests6.java')
-rw-r--r-- | csci1913/Java/lab6/tests6.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/csci1913/Java/lab6/tests6.java b/csci1913/Java/lab6/tests6.java new file mode 100644 index 0000000..fc98648 --- /dev/null +++ b/csci1913/Java/lab6/tests6.java @@ -0,0 +1,28 @@ +package lab6; + +// SHAPES. Public tests for the classes RECTANGLE and SQUARE. Comments show +// what each test must print, and how many points it is worth. + +class Shapes +{ + public static void main(String[] args) + { + Rectangle wreck = new Rectangle(3, 5); + + System.out.println(wreck.side(0)); // 3 1 point. + System.out.println(wreck.side(1)); // 5 1 point. + System.out.println(wreck.side(2)); // 3 1 point. + System.out.println(wreck.side(3)); // 5 1 point. + System.out.println(wreck.area()); // 15 1 point. + System.out.println(wreck.perimeter()); // 16 1 point. + + Square nerd = new Square(7); + + System.out.println(nerd.side(0)); // 7 1 point. + System.out.println(nerd.side(1)); // 7 1 point. + System.out.println(nerd.side(2)); // 7 1 point. + System.out.println(nerd.side(3)); // 7 1 point. + System.out.println(nerd.area()); // 49 1 point. + System.out.println(nerd.perimeter()); // 28 1 point. + } +} |