<h2>Solution :</h2>
The given problem is solved in Python.
def ComputeSquare():
side = float(input('Enter the side of the square: '))
if side > 0:
perimeter = 4 * side
area = side * side
print('Perimeter of the square is:',
perimeter, 'unit.')
print('Area of the square is:', area, 'square unit.')
<h3> else:</h3>
print('Invalid input.')
ComputeSquare()
<h2>Explanation :-</h2>
- In this program, we create a function ComputeSquare() to calculate the perimeter and area of a square.
- The function asks the user to enter the side of the square. The side is then stored in a variable.
- Now, we check whether the side is greater than 0 or not using if-else statement.
- If the condition is true, the perimeter and area is calculated which is displayed using print() statement.
- If the condition is false, the else blocks executes printing the error message.
<h3>Refer to the attachment for output.</h3>
The answer is : to more easily access and save information and to reduce waste. It is more convenient to receive and store our information in a digital format. when we reduce paper waste by using technology more.
Answer:
b) The elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle.
Explanation:
Elevator routing often looks complex, as the elevator has to decide whether to go to the person who has waited the longest or the one who is closest? There are also issues of how long should the rider spend.
A simple algorithm can be designed where the elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle. Once it exhausts the request in its current direction, it then switches directions if there are requests in that direction. This way the elevator is able to tackle the complex issue based on the simple algorithm.