1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
PilotLPTM [1.2K]
2 years ago
10

On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance

(number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('%0.2f %0.2f %0.2f %0.2f %0.2f' % (your_value1, your_value2, your_value3, your_value4, your_value5))
Computers and Technology
1 answer:
Stels [109]2 years ago
3 0

Answer:

#include <stdio.h>

int main()

{

float your_value1, your_value2, your_value3, your_value4, your_value5;

printf("Enter a frequency: ");

scanf_s("%f", &your_value1);//storing initial key frequency in your value 1

 

float r = 2.0 / 12;//typing 2.0 so it is treated as float and not int

your_value2 = your_value1 * r * 1; //initial*r*n

your_value3 = your_value1 * r * 2; //initial*r*n

your_value4 = your_value1 * r * 3; //initial*r*n

your_value5 = your_value1 * r * 4; //initial*r*n

printf("%0.2f %0.2f %0.2f %0.2f %0.2f", your_value1, your_value2, your_value3, your_value4, your_value5);

return 0;

}

Explanation:

The purpose of this exercise is to make you understand the difference between float and int. float variables are used when you need decimals in your calculations. int is used when you need integers. The problem in this exercise was the formulation of r. Now r is = 2/12, this means that when we type r as that, the computer assumes that it is an integer and treats it as such. So, it will convert the 0.166667 into 0. To overcome this, all you have to do is type 2.0 instead of 2 alone.

The %0.2 command restricts the float variable to 2 decimal places. By default, it has 6 decimal places.

I have used the function scanf_s instead of scanf simply because my compiler does not work with scanf.

You might be interested in
Who is affected by electronuc theft of a song ?
Sonbull [250]
I would have to say the artist.
simply because the artist or publisher does not receive any income on their product. 
7 0
3 years ago
Read 2 more answers
The ____ criteria filter requires the records displayed to start with the specified text string
lys-0071 [83]

The "Begins With" criteria filter is what your looking for

3 0
3 years ago
(True/False) Utilizing a higher bandwidth can support a larger volume of data (in bits per second) to be transmitted than a lowe
lions [1.4K]

Answer:

True

Explanation:

Bandwidth refers to the maximum data transfer rate across the communication media it refers to the amount of information sent for unit time and it's not related to the speed at which data is transferred (latency) but rather the amount of information. As an analogy imagine a full-pipe, the width of the pipe is related to the amount of water per unit time across the pipe (bandwidth).

3 0
3 years ago
Read 2 more answers
Eric is adding three more slides to his PowerPoint presentation. He knows he wants one of them to have only a large text box, th
marissa [1.9K]

The buttons depend on what version of MS Office he is using. Assuming Eric is using Powerpoint 2013, he must press the following: 

1st Slide: Insert > New Slide > Title Only

2nd Slide: Insert > New Slide > Comparison > Click on "Pictures" icon > Browse > Click selected picture > Insert > Delete text box saying "Click to add title" > Insert another picture using same procedures above > Add captions

3rd slide: Insert > New Slide > Two Content > <span>Click on "Picture" icon > Browse > Click selected picture > Insert 3 more pictures > Click textbox "Click to add title" </span>

3 0
3 years ago
Refer to the exhibit. Switch SW2 was tested in a lab environment and later inserted into the production network. Before the trun
svet-max [94.6K]

Answer:

Switch SW2 seems to have a greater VTP revision number that creates the VLAN data to be deleted in the VTP domain.

Explanation:

Switch SW2 became examined and eventually placed into another production network. Prior to connecting the trunk connection among both SW1 and SW2, the service provider admin enacted the exhibit vtp status instruction as shown in the monitor. Both clients missed access to the network shortly when the switches got linked.

So, the possible reason for the issue is to Switch SW2 tends to have a larger VTP modification percentage allowing that VLAN data to be removed from the VTP domain.

8 0
3 years ago
Other questions:
  • The factorial of an integer N is the product of the integers between 1 and N, inclusive. Write a while loop that computes the fa
    10·1 answer
  • Write a program that prompts the user for their quarterly water bill for the last four quarters. The program should find and out
    5·1 answer
  • Why is it important to cite your sources?
    8·2 answers
  • ____ steganography places data from the secret file into the host file without displaying the secret data when you view the host
    9·1 answer
  • Select the correct answer.
    10·1 answer
  • Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "
    14·1 answer
  • Which components exist in the contextual tab for tables called Design? Check all that apply.
    15·2 answers
  • Explain the Decision making statement​
    15·1 answer
  • An organization is conducting a study to see if hazardous waste sites pose health risks for cancer or other conditions, such as
    12·1 answer
  • Describe, with examples, the way in which a defect in software can cause harm to a person, to the environment, or to a company
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!