subject

On a piano, each key has a frequency, and each subsequent key (black or white) is a known amount higher. ex: the a key above middle c key has a frequency of 440 hz. each subsequent key (black or white) has a frequency of 440 * rn, where n is the number of keys from that a key, and r is 2(1/12). given an initial frequency, output that frequency and the next 3 higher key frequencies. if the input is 440, the output is: 440 493.883 523.251 554.365.
note: include one statement to compute r = 2(1/12) using the pow function, then use r in the formula fn = f0 * rn. (you'll have three statements using that formula, different only in the value for n).
(note 4/17/17: a student noticed that our example and test cases are skipping n=1, starting instead with n=2. we won't change the lab right now, so just assume you've been asked for steps n=2, 3, and 4.)

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, Melissamv2052
Selective incapacitation is a strategy to reduce prison population
Answers: 3
image
Computers and Technology, 22.06.2019 07:30, alexandramendez0616
Jasper and samantha are in a robotics competition. the guidelines state that the robots should be able to move a 10-gram weight at least 2 meters and turn in a circle. jasper and samantha have already built the robot. which step of the design process should they follow next to decide whether their robot meets the minimum criteria for the competition?
Answers: 1
image
Computers and Technology, 22.06.2019 13:00, jairus34
We as humans write math expression in infix notation, e. g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i. e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix. write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
image
Computers and Technology, 24.06.2019 04:10, kris1920
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
You know the right answer?
On a piano, each key has a frequency, and each subsequent key (black or white) is a known amount hig...

Questions in other subjects:

Konu
Mathematics, 15.02.2021 14:00
Konu
Health, 15.02.2021 14:00
Konu
Mathematics, 15.02.2021 14:00