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
The answer is multitasking. This is when the OS always programs to share resources to run at the same time.
If the applications were running on separate CPUs, then it would be multiprocessing.
Explanation:
Pre-production formally begins once a project has been greenlit. At this stage, finalizing preparations for production go into effect. Financing will generally be confirmed and many of the key elements such as principal cast members, director and cinematographer are set. By the end of pre-production, the screenplay is usually finalized and satisfactory to all the financiers and other stakeholders.
During pre-production, the script is broken down into individual scenes with storyboards and all the locations, props, cast members, costumes, special effects and visual effects are identified. An extremely detailed shooting schedule is produced and arrangements are made for the necessary elements to be available to the film-makers at the appropriate times. Sets are constructed, the crew is hired, financial arrangements are put in place and a start date for the beginning of principal photography is set. At some point in pre-production, there will be a read-through of the script which is usually attended by all cast members with speaking parts, the director, all heads of departments, financiers, producers, and publicists.