Question: Array Free Response Assignment What Did You Say, Sonny? name: date Alert! Alert! The World Health Organization has warned that 1.1 billion teens are at

 Array Free Response Assignment What Did You Say, Sonny? name: dateAlert! Alert! The World Health Organization has warned that 1.1 billion teens

Array Free Response Assignment What Did You Say, Sonny? name: date Alert! Alert! The World Health Organization has warned that 1.1 billion teens are at risk of hearing loss because of music heard through earbuds where the volume can reach about 102 decibels (dB) if cranked up 75dB are considered "safe"). It only takes one exposure to excessive sound to damage your hearing. The Central Institute of Loud Invasive Amplitudes, or CILIA, is marketing a gauge that takes in sample music value is its absolute value (sound travels in waves). For example, the amplitude of -2300 is 2300, and the amplitudes. The volume of a sound depends on the amplitude of each value in the sound. The amplitude of a amplitude of 4000 is 4000. CILIA has heard (hah!) of your programming prowess, and wants you to write code that will do the following: Given an array some other CS whiz creates, what, your code will change any value that has an amplitude greater than a given positive integer limit, beQuiet, that is set by the customer. Values greater than beQuiet are replaced in the array what with beQuiet, and values that are less than -beQuiet are replaced with -beQuiet. Return the total number of values that were changed in array what. For example, assume that the array what has been initialized with the following values. 40 2532 17-230017 -4000 2000 1048-420 3315 -32 2030 3223 When your code is started and the customer has randomly set beQuiet to 2000, then the final array should look like: 40 2000 172000 17-2000 2000 1048-420 33 15 -32 2000 2000 And you should return 5 since 5 values were changed in the array Suppose another array is as follows, and the customer has set beQuiet to 150, what is the result of your code? 40 2532 -120 2300 -170 -4000 200150 322 Result: And you should return. Assume that what[] is an instance variable that has been filled with different integer amplitudes values, and that the size of the array varies with each use of your code. Assume the customer has provided the desired noise level by initializing the integer variable beQuiet. You will write code for the amplitudeChecker method It is in the same class as the what[] instance variable and passes beQuiet as a parameter. Read, reread, re-reread the specifications on the first page and create an algorithm that will do what CILIA wants. Algorithm: (Write steps like a recipe. See example to the right.) Algorithm asking a user for an email address Step 1: Start Step 2: Create a variable to receive the user's Step 3: Clear the variable in case it's not empt Step 4: Ask the user for an email address Step 5: Store the response in the variable Step 6: Check the stored response to see if it Step 7: Not valid? Go back to Step 3. Step 8: End email address valid email address Test your algorithm against the two examples on the first page. Don't skip this step. Many mistakes can be fixed once you walk your code through the paces. Now write the actual code that will do your algorithm's duties. The method heading has been given Java Code: public in amplitudeChecker (int beQuiet)

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!