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]
3 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]3 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
Where should a "deny all catch all" rule be positioned and why?<br> pleaseeee help!
insens350 [35]

Answer: For best performance and lowest latency, the MMU and CPU should support hardware ... broadcast, and subnet broadcast traffic with the deny-all catch-all filter rule for ... Please refer to the NetSight Wireless Manager User Guide (v5.1 or higher ) for a ... The rule must also be positioned above the 'Deny All' Default action.

Explanation:

6 0
3 years ago
Read 2 more answers
Trace the code below to find the two errors.
nasty-shy [4]

Answer:subtotal =.08

Explanation:

8 0
2 years ago
Let's consider a long, quiet country road with houses scattered very sparsely along it. (We can picture the road as a long line
Rus_ich [418]

Answer:

Follows are the solution to these question:

Explanation:

A simple gullible algorithm is present. Let h mark the house to the left. Then we put a base station about 4 kilometers to the right. Now delete and repeat all the houses protected by this base station. In this algorithm, they can simply be seen to position baselines at b1, . . , bk as well as other algorithms (which may be an optimum algorithm) at b'_{1}, \ . . . . . . ,b'_{k'}  and so on. (from left to right)   b_1 \geq b'_{1},\ \  b_2 \geq b'_{2} That's why k \leq k'.

7 0
2 years ago
Which is the best tip for optimizing a TrueView video for viewer engagement?
Ivenika [448]

Answer: (A) Look at engagement rate for targeting and focus on the methods with the highest view through rate

Explanation:

TrueView video enables to post ads in social sites however it is paid by the sponsor only if the ad is viewed fully or in some cases it is viewed only upto 30s of the total size of the video.

So in order to have a larger viewer engagement it is necessary for it to focus on the methods which would garner it highest views.

So option A is correct.

Option B and c are not correct these options would not cater to the needs of the viewer.

5 0
3 years ago
Businesses around the world all need access to the same data, so there
Alexxx [7]

Answer:

B

Explanation:

3 0
2 years ago
Other questions:
  • HELLLLLP ill make you brainiest and ill give u a lot of points if you HELP ME Directions Part One.
    12·2 answers
  • #A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
    5·1 answer
  • 1) why is software engineering considered engineering and not manufacturing?
    9·1 answer
  • A provides an easy way for workers to interact with their computers
    9·1 answer
  • _____ is when a person connects their location to photos that are posted online.
    5·2 answers
  • /*
    8·1 answer
  • Arrange the types of movies in terms of the amount of content they can hold
    14·1 answer
  • The purpose of a malfunction indicator lamp (MIL) is to:
    12·1 answer
  • Why is it difficult to convince top management to commit funds to develop and implement a Strategic Information System
    13·1 answer
  • Which symbol would be used in a flowchart to represent a connection to another part of the flowchart
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!