Answer:
class Books(object):
books_count = 0
books = {}
#classmethod
def book_count(cls):
cls.books_count +=1
#classmethod
def add(cls, title, author, year, status):
if cls.books_count < 100:
cls.book_count()
cls.books[title] = [author, year, status]
else:
print("Book register has reached it's limit.")
#classmethod
def check(cls, book_name):
return cls.books.get(book_name)
please replace the '#' with the 'at' sign.
Explanation:
The python class defines several class methods namely; add, check and book_count. The add method adds books to the book dictionary in the class as a class attribute, the check method check for the presents of a book title in the book dictionary while the book_count method adds one to the books_count class variable which checks the dictionary size.
Answer:
Explanation:
The following code is written in Python, it asks the user for the number of minutes worked. Divides that into hours and minutes, saves the values into separate variables, and then prints the correct statement using those values. Output can be seen in the attached image below.
import math
class HoursAndMinutes:
min = input("Enter number of minutes worked: ")
hours = math.floor(int(min) / 60)
minutes = (int(min) % 60)
print(str(hours) + " hours and " + str(minutes) + " minutes")
Answer:
Explanation:
This code is written in Java. It creates a Rectangle class that contains variables for the height and width. It also contains constructor, methods for calculating perimeter and area, and a printInfo method to print out all the results. A test case has been created in the main method which creates a Rectangle object and prints out the printInfo which calls the area and perimeter methods as well. The output can be seen in the attached image below. Due to technical difficulties I have added the code as a txt file below.
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
txt
</span>
Answer:
Grosch
Explanation:
Grosch 's law is the mathematical formular that belief that large and powerful computers will be more costly than the smaller one because the functions and performance of the large and powerful computers cannot be compared with the smaller ones. He believes that the more costly a computer is the high the performance will be which means that low cost computer are not up to standard of a high cost computer in the market.