Question: Problem A: Snells Law (10 points) This problem will relate to Snell's law. For how waves bend when transitioning through patches of different density (like

Problem A: Snells Law (10 points) This problem will relate to Snell's law. For how waves bend when transitioning through patches of different density (like air and water). Write a C++ program that takes three inputs (shown below as underlined, though when you actually enter them into the program they will not be underlined): (1) The angle in the first medium (theta_1),(2) the index of refraction (n_1) in the first medium and(3) the index of refraction in the second medium (n_2). You should then output the angle in the second medium (theta_2). Note: both angles should be given/shown in terms of the inferior degree system (rather than radians).

Please try to follow this format for the examples as close as possible... basically exactly (otherwise the grading script might misinterpret what your final answer is). The final output is just a simple cout (this will typically be the case unless otherwise specified) without any formatting modifications.

Example 1 (user input is underlined for clarity, underlined text in your program is not needed):

Enter the angle for the first medium:30

Enter index of refraction for the first medium:1.33

Enter index of refraction for the second medium: 1.0

Angle in second medium is: 41.6823

Example 2 (user input is underlined for clarity, underlined text in your program is not needed):

Enter the angle for the first medium: -15.5

Enter index of refraction for the first medium: 0.6666

Enter index of refraction for the second medium: 3.21

Angle in second medium is: -3.1813

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!