Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

2. What additional techniques might be used to assess talent?

Answered: 1 week ago

Question

=+management system of the MNE?

Answered: 1 week ago