CSC1110 - Week 13 Exercise

Overview

In this exercise, you will gain practice with using Exceptions in different contexts.

Circle

Create a Circle class that contains the following:

Homework13

This driver class must contain the following methods:

Sample Output

Example 1

Enter a non-negative number for how many times you want to make a Circle.
3
Enter the radius for the Circle.
1
Enter the radius for the Circle.
2
Enter the radius for the Circle.
3
Circles entered: 
[Circle{circumference=6.28}, Circle{circumference=12.57}, Circle{circumference=18.85}]

Example 2

Enter a non-negative number for how many times you want to make a Circle.
3
Enter the radius for the Circle.
no
Error radius must be a valid double. Skipping this input.
Enter the radius for the Circle.
-1
Error radius must be positive. Skipping this input.
Enter the radius for the Circle.
3
Circles entered:
[Circle{circumference=18.85}]

Example 3

Enter a non-negative number for how many times you want to make a Circle.
no
Error, number of Circles must be a whole number.

Example 4

Enter a non-negative number for how many times you want to make a Circle.
-1
Error, number of Circles must not be negative number.

Submission Instructions

Commit and push your code to your repository.