Answer:
There is not a reason for the two methods to be private unless you want to only allow objects of the class Rational to have access to these methods. Perhaps your professor has a particular reason for requiring it to be set up as such.
Explanation:
The use of the private space simply restricts access to either variables or methods contained within the space to the class object that is associated with the variable or methods.
The use of the public space allows the method or variable to be accessed from anywhere within the program.
Note, if using class inheritance, classes that inherit from the Rational class will not be able to access the private functions.
Answer:
She made the first computer.
Explanation:
Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, chiefly known for her work on Charles Babbage 's proposed mechanical general-purpose computer, the Analytical Engine.
Upper case and lower case problem
This for loop will output:
0
2
4
The range(3) is all the integers between 0 inclusive and 3 exclusive. 0, 1, 2.
Every iterations through the for loop, we multiply the value of each number by 2 and print it to the console.
0 * 2 = 0
1 * 2 = 2
2 * 2 = 4
I hope this helps.