Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program. The brightness of a binary star varies as follows. At time t = 0 days its magnitude is 2.5, and it stays at

C++ program.
The brightness of a binary star varies as follows. At time t = 0 days its magnitude is 2.5, and it stays at this level until t = 0.9 days. Its magnitude is then determined by the formula

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

Until t = 2.3 days its magnitude is then 2.5 until t = 4.4 days, and it is then determined by the formula

( 3.598 - ln(1.988 + cos(Pi(t-4.4)/0.4))

Until t = 5.2. It then remains at 2.5 until t = 6.4 days, after which the cycle repeats with a period of 6.4 days. Write a program which will input the value of t and print the brightness of the star at that time. Use the value of = 3.14285714. Your program should give the user the option to repeat the process of computing the brightness of star or stop (EXIT) the code. Also, you should use nested if, switch control structure statements in your solution as described in the table below. Your results should be displayed in five decimal places.

image text in transcribed
Style nclude, comments naming indentation) Decla input. Use of nested if if statements se of switch se of o Calculations Without Emos Total Enter the tine 1 5 The brightness of the star at tine 5.000000 is 2.90490 (E) or (e) to Exit Any other character to repeat ter your choice nter the tine(t) 0 he brightness of the star at tine e.e0000 is 2.50000 (E) or to Exit Any other character to repeat nter your choice: R nter the time(t): 6.2 The brightness of the star at tine 6.20000 is 2.seeee (E) or (e) to Exit Any other character to repeat nter your choice ter the time (t): 1 The brightness of the star at tine 1.0000e is 2.54279 (E) or (e) to Exit Any other character to repeat nter your choice Enter the tine(t): 7 The brightness of the star at time 7.00000 is 2.50000 (E) or (e) to Exit Any other character to repeat

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago