Answer:
The solution code is written in Python:
- def square(num):
- if type(num).__name__ == 'int':
- sq_num = num * num
- return sq_num
- else:
- return "Invalid input"
-
- print(square(5))
- print(square("Test"))
Explanation:
To ensure only certain type of operation can be applied on a input value, we can check the data type of the input value. For example, we define a function and name it as <em>square</em> which take one input number, <em>num </em>(Line 1).
Before the <em>num</em> can be squared, it goes through a validation mechanism in by setting an if condition (Line 2) to check if the data type of the input number is an integer,<em> int.</em> If so, the<em> num </em>will only be squared otherwise it return an error message (Line 6).
We can test our function by passing value of 5 and "Test" string. We will get program output:
25
Invalid input
<span>Joel is a victim of a security breech. By leaving his computer unattended and not locked, he allowed for another person to use his credentials to access (or attempt) to access information that would otherwise be restricted to him. The fact that the unauthorized person did not find the information he was seeking does not minimize the risk.</span>
Answer:
22.5
Explanation:
My weight = 100 pounds
Sister's weight = 150
Distance from fulcrum = 15 ft
Distance has an inverse proportion with weight
Distance = k/w
Where k is a constant
K = distance x weight
K = 100 x distance
150 x 15 = 100 distance
2250 = 100 distance
Divide through by 100 to get distance
2250/100 = distance
Distance = 22.5
I = 0
while( i < ( n * 2 ) ):
s += '*'
i += 1
Answer:
The boss, since it’s none of her business that Delilah’s appointment was for mental health, and asking for a doctor’s note after the fact is harassment, and docking her pay might be illegal.
That's what I think (I hope I'm right).