Output that frequency and the next 3 higher

Assignment Help Basic Computer Science
Reference no: EM132200911

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.)

starting code:

#include <iostream>

#include <cmath>

using namespace std;

int main() {

  int startingFrequency; 

  /* start code here. Include the math library above first. */

  return 0;

}

Reference no: EM132200911

Questions Cloud

Write a program that determines the largest of 3 integers : Write a Java Program that determines the largest of 3 integers. User prompt that asks the user to input 3 integers.
What is conditional formatting : 1. What is conditional formatting? 2. Describe how to format a table.
Write a java program to display a dialog box : Write a Java program to display a dialog box that asks you to enter your user name and the age.
What economic forces might be responsible for the change : In the single graph, show how the labor force participation rate for men and also for women have changed over time. What do you notice?
Output that frequency and the next 3 higher : 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.
Write a java program that can convert an letter grade : Write a JAVA program that can convert an letter grade A,B,C,D and display it corresponding numeric value 4,3,2,1 or 0.
Rectangle length times its width : The area of a rectangle is the rectangle's length times its width. Can someone draw an example flowchart that asks for the length and width of two rectangles
User input number is odd or even : Can you type up a pseudocode, that has a module check that decides if a user input number is odd or even. Any programming language is fine, it's just a test pse
At what price does the firm make zero profits : Assume that w = r = 1 and that k = k. Suppose that half of the fixed cost is nonsunk. For the following production function, derive the short-run supply.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  De?nition of garbage

This question asks you to think about garbage collection in Lisp and compare our de?nition of garbage in the text to the one given in McCarthy's 1960 paper on Lisp. McCarthy's de?nition is written for Lisp speci?cally, whereas our de?nition is sta..

  Purpose of creating a template

What is the purpose of creating a template? Describe the features of a professional presentation. What screen features would make the presentation.

  Difference between olap analysis and drill-down analysis

What is the difference between OLAP analysis and drill-down analysis? Provide an example of the effective use of each technique.

  Explain javascript in html

Explain JavaScript in HTML. What does JAVAScript add to HMTL why is it used?

  Why does dumping occur in economics

Why does dumping occur in economics and what is a good definition for it?

  Independent research on encryption

What are some of the latest advances in encryption technologies? Conduct some independent research on encryption using scholarly resources, then write a two- to three-page APA paper that describes at least two new advances in encryption technology

  Wap to find account numbers that contain most matching words

Write a program that finds the account numbers that contain the MOST matching words in the file. If there are several such account numbers.

  Discuss the constituent parts it/is professional ethics

Connect or relate the discussed constituent parts into an overall structure that may relate to an IT/IS code of conduct or ethics.

  What is the rms voltage of the signal

An AM transmitter with a carrier power of 10 W at a frequency of 25 MHz operates into a 50-? load. It is modulated at 60% by a 2-kHz sine wave.

  What kind of questions did they ask you

What kind of questions did they ask you? How could you have better prepared for the interview?

  Can the bond rate be predicted by the prime interest rate

In my DSCI 3321 class I have a question for problem 12.9. I know how to plot the data but the problem I am having is how to interpret the data to answer

  Requirements and policies of the secure wireless network

State the requirements and general security policies that will drive your design of a secure wireless network at the SOHO. It should be about 5-10 sentences or bullet points.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd