Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class called Star to store data and methods associated with individual stars. It should contain the following attributes: name as a string right
Create a class called Star to store data and methods associated with individual
stars. It should contain the following attributes:
name as a string
right ascension as a tuple hours minutes, seconds
declination as a tuple degrees arcminutes, arcseconds
distance as a float pc
absolute magnitude as a float
The constructor method should take these as arguments and use them to set the
values of the attributes associated with the object.
Give the class two methods:
appmag returns the apparent magnitude using
strreturns the string representation of the star, like the following
use embedded newlines
Star: Betelgeuse
:
Dec:
Mag:
Dist:
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