Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image

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 amplitudes. The volume of a sound depends on the amplitude of each value the sound. The amplitude of a value is its absolute value (sound travels in waves). For example, the amplitude of -2300 is 2300, and the 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. D 40 40 2532 -2300 -17 -4000 2000 { -2000 The method heading is given: When your code is started and the customer has randomly set beQuiet to 2000, then the final array should look like: -17 -2000 2000 public int amplitudeChecker 1048 2000 1048 -420 33 (int beQuiet) -420 15 33 -32 15 2030 -32 The method should return 5 since 5 values were changed in the array. Assume that what[] is an instance variable that has been filled with different integer amplitude 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. 2000 3223 2000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Marketing And Export Management

Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr

8th Edition

1292016922, 978-1292016924

More Books

Students also viewed these Algorithms questions

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago