Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Problem 4 In astronomy, luminosity is the total amount of energy emitted per unit of time by a star, galaxy, or other astronomical object.
C++
Problem 4 In astronomy, luminosity is the total amount of energy emitted per unit of time by a star, galaxy, or other astronomical object. We can calculate the luminosity, L, of a star using its apparent brightness, b (how bright it looks from earth), and the star's distance from the observer, d, using the formula: Write a function luminosity that implements this formula. Your function MUST be named luminosity Your function should accept two input arguments: brightness and distance, as doubles Your function should return the value of the luminosity as an int (you will have to cast it to an integer value) Your function should not print/display/output anything . For t use the value 3.14159 For example, given initial values of: b -1.5 and d 17.8, your function would return 5972 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started