Question: Create a program ( in c++) will prompt the user to enter a time in days and calculate the magnitude of the binary star for

Create a program ( in c++) will prompt the user to enter a time in days and calculate the magnitude of the binary star for that time. Your program should use a simple if to ensure that the entered time is valid (greater than or equal to 0) and prompt the user to re-enter if the entered time is invalid. Then use an if-elseif structure to determine the magnitude for the entered time. Your output should be similar to At _____ days the magnitude of the binary star is _______. Output the days to 3 significant figures and the magnitude to 5 significant figures. Hint: The fmod function will calculate the remainder of floating point division

Problem: Astronomers have measured the magnitude (brightness) of a binary star as a function of time and found it to have periodicity (cycle) of 6.4 days. The magnitude varies as given below.

from times t = 0 days until t = 0.9 days the magnitude is 2.5

from times t = 0.9 days until t = 2.3 days the magnitude may be calculated by the formula

3.355 - ln(1.352 + cos(*(t - 0.9)/0.7))

from times t = 2.3 days until t = 4.4 days the magnitude is 2.5

from times = 4.4days until t = 5.2 days the magnitude may be calculated by the formula 3.598 - ln(1.998 + cos( *( t - 4.4)/0.4))

from times = 5.2 days until t = 6.4 days the magnitude is 2.5 At 6.4 days the cycle begins again as if the time was 0 days.

A graph for 2 cycles (12.8) days is given below.

Create a program ( in c++) will prompt the user to enter

Can somone please help me with this program?

4.4 4.2 3.8 3.6 3.4 3.2 2.8 2.6 2.4 10 12 14

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!