Answered step by step
Verified Expert Solution
Link Copied!

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 m-M=5(logd-1)
str_returns the string representation of the star, like the following
(use embedded newlines)
Star: Betelgeuse
RA:,05h55m10.3s
Dec: ,+07d24'25.4"
Mag: ,-5.85
Dist: 220.0pc
image text in transcribed

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

Step: 3

blur-text-image

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago