Question: For this project, please create a Java class called RadioStationException that extends Exception. RadioStationException should have a constructor that receives a radio station's call sign

For this project, please create a Java class called RadioStationException that extends Exception. RadioStationException should have a constructor that receives a radio station's call sign (for example, WJRR) and carrier frequency (for example, 101.1).

Create a second class named RadioStation that has the same fields and whose constructor requires values for both fields. Upon construction of a RadioStation object, throw a RadioStationException if the call sign does not consist of four letters or if the carrier frequency is not between 88 and 108 inclusive.

Finally, write an application that creates an array of at least six RadioStation objects by asking the user to input call signs and carrier frequencies. Display an appropriate message when a RadioStation object is created successfully and also when one is not. Be sure to test your program with valid and invalid values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!