Question:
Eric works in a door mat manufacturing company. One day, he designed a new door mat with the
following specifications:
◦ Mat size must be A x B. (A is an odd natural number, and B is 3 times A.)
◦ The design should have ‘WELCOME’ written in...
Posted at 02:37h
in
Uncategorized
by admin
Question:
Create a Rocketclass with two attributes: nameand destination. SpaceRocketclass is the inherited class from the base class Rocket. Besides the two attributes the base class has, SpaceRocketclass has an attribute maker.
The Rocketclass has a method called launch(), it returns a string like "Falcon 9(which is...
Posted at 01:54h
in
Uncategorized
by admin
Question:
Make a class definition for a BankAccount. It should have attributes for :
– its name (a string),
– account number (a string or integer),
– and balance (a float).
It should have methods to:
– make deposits with displaying the balance,
– and make withdrawals with displaying the balance.
Hint:
...
Question 1:
The hailstone sequence starting at a positive integer n is generated by following two simple rules. If n is even, the next number in the sequence is n/2. If n is odd, the next number in the sequence is 3*n+1. Repeating this process, we generate the hailstone sequence. Write a recursive function hailstone(n) which prints the...
Posted at 01:50h
in
Uncategorized
by admin
Question:
Make a class definition for a BankAccount. It should have attributes for :
– its name (a string),
– account number (a string or integer),
– and balance (a float).
It should have methods to:
– make deposits with displaying the balance,
– and make withdrawals with displaying the balance.
Hint:
...
Posted at 21:45h
in
Uncategorized
by admin
Question:
Alice is looking at a crystal through a microscope. Alice’s microscope has the interesting feature that it can superimpose grid lines over the image that she is looking at.
At level 1 of magnification, Alice sees the image as follows:
Notice that at level 1, there is...