Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Jupyter Notebook, develop an object - oriented application that will perform calculations on rational numbers. While you are responsible for the application's final design,
Using Jupyter Notebook, develop an objectoriented application that will perform calculations on rational
numbers. While you are responsible for the application's final design, your application is expected to contain a
class called ratNum representing a rational number where a and are both integers. You may assume that
is positive for simplicity, and the application does not need to check this. However, if the value of is zero, an
error message should be displayed to alert the user that it is not allowed. Within the class, you must write public
member functions to realize one of the following five tasks. The task to do should be determined by the
remainder obtained from dividing your team number by For example, if your team number is SEVEN,
and you should do Task of this assignment.
The member function performs the multiplication with another rational number and returns the result as a
rational number. The result has to be in its simplest form, ie any common factors between the numerator
and the denominator should be canceled out. For example, if this rational number has a and b the
rational number to be multiplied has a and b the function should return ie a
rational number of a and b in its simplest form.
It is required that the class and the implementation of its member functions should be built as a separate
module to be imported by the application.
Your application is expected to provide a text menu as a user interface. Through the interface, the user can
repeatedly enter rational numbers by providing the values of a and b and do calculations of your task for
different rational numbers. The user can also choose to end the application through the interface.
Should you want to get a credit grade, you should design the application such that when a user wants to start
it he needs to login with a username first, which will be checked with a file that stores usernamepassword
pairs. If the username is new, the application will ask for a password from the user and store it into that file.
If the username can be found in that file, the application will ask for a password from the user, and the program will start only when the password is correct. The application will end if the user fails to provide the correct
password in three consecutive trials.
Should you want to get a distinction grade, you should add a function to the class that can compute a nonzero rational number to the power of n where n is a positive integer, zero, or negative integer. If the rational
number is zero, the function should show an error message and do nothing. The result must be a rational
number in its simplest form. For example, if the rational number has a and b and n the function
should return a rational number of a and bYou should
also consider computing rational number to the power of another rational number.
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