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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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