Question: java & python Create a class named Rational. Follow each language's rules and conventions to name your source files Python.java and python.py respectively. Your class

java & python
java & python Create a class named Rational. Follow each language's rules

Create a class named Rational. Follow each language's rules and conventions to name your source files Python.java and python.py respectively. Your class must have: the name Rational a constructor (initializer) that takes two integers as its parameters. a method named equals that takes another Rational as its parameter and returns true if you can determine that the two Rationals are equal; false otherwise. Your class must specify the data type of the following values, replacing "type" with the name of the type (int, boolean, bool, or Rational): Java syntax Python PEP 484: (won't compile if (lose points if omit omitted) method's type def method_name return type method_name(...) type: (not used for constructors) parameter type method_name(type method_name(par parameter....))...) type, ...))... type of type (not needed this e property/field property_name: of class Java requires these declarations. In Python, type hints are syntactically optional and have no semantics (they don't affect the running of the program). Nevertheless, expect you to use them because they help you communicate with other developers and avoid making mistakes. Do as little as possible to satisfy those requirements! Do not (yet) implement any error/bounds checking; don't worry about encapsulation (public/private); don't reduce the Rational to its canonical form, provide accessors or string representations, mathematical operations, or any of those very appropriate good things to do. You don't even have to write comments. We'll get there

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!