Question: In a previous exercise, you were asked to create a car radio. The assignment required you to draw and label the components. In this lab

In a previous exercise, you were asked to create a car radio. The assignment required you to draw and label the components. In this lab you will build a simplified car radio object using the JavaScript template with several properties and methods. Your car radio object must meet the following requirements:
The car radio must be named carRadio.
The car radio must have the following components (properties):
powerStatus - determines if the radio is off or on.
volume - provides the level of amplification ("loudness")
device - toggles between FM and external device.
fmStation - indicates the frequency of the currently selected band when the device is in FM mode. If device is external the station is empty string or "".
The car radio must have a set and get method for EVERY property (4 set methods and 4 get methods).
The set methods for the following properties must meet the following conditions:
Power status can only accept the values "off" or "on".
Volume can only accept the values between 0 and 10(inclusive).
Device can only accept the values "FM" and "EXTERNAL" (case sensitive).
Station should check that the device is "FM" and not "EXTERNAL". If the device is "EXTERNAL" the station should not change
Your object should contain a method to display each of the properties in the order ( power status, volume, device, and fmStation) on the web page when the values are initially set and after the values have been changed.
Hint: Remember conditional statements are if statements or switch statements. By adding conditional statements we can ensure that our conditions are met. If an incorrect value is sent to the set method, the object should retain its previous value.
Please submit your work as an HTML document with the naming convention CMSY-172-N09X_FirstInitialLastName_Lab# (replacing the X with your section, FirstInitialLastName with your personal information and the # with the exercise number).
Rubric
Lab 4- Car Radio
Lab 4- Car Radio
Criteria Ratings Pts
This criterion is linked to a Learning OutcomeThe car radio object must be named carRadio and contain all required components
2 pts
Full Marks
0 pts
No Marks
2 pts
This criterion is linked to a Learning OutcomeThe car radio must have a set and get method for EVERY property
2 pts
Full Marks
0 pts
No Marks
2 pts
This criterion is linked to a Learning OutcomeThe set methods must validate input
The set methods for the properties must meet the conditions described in the directions.
4 pts
Full Marks
0 pts
No Marks
4 pts
This criterion is linked to a Learning OutcomeThe car radio object contains a method to display the properties in order.
2 pts
Full Marks
0 pts
No Marks
2 pts
Total Points: 10

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 Programming Questions!