A program that repeatedly prompts a user for integer numbers :
biggest = none
smallest = none
while True:
input = raw_input(“Enter a number:”)
if(input == “done” break
try:
number = float(inp)
except ValueError:
print “Please enter only numbers”
else
if smallest is None:
smallest = number;
biggest = number;
elif number < smallest:
smallest = number
elif num > largest:
largest = number
Print “Greatest is “, biggest
Print “Smallest is”, smallest
In this program an input is obtained, if it is equal to the word “done”, then the program stops b printing greatest and smallest number in the given input.
If invalid inputs are given then user is prompted to enter valid number. Otherwise the value of smallest and greatest are calculated according to the input using if-else construct.
Answer:
b. instantiated.
Explanation:
In computer programming, to be instatiated or when variables are instatiated; this simply refers to the acts of making example out of a group variables or a form of template. For example in a situation of class of objects.
Hence, in this case, the correct answer to the question above is the option B, in which Variables set equal to patterns are said to be INSTATIATED
Answer:
6=110
13=1101
18=10010
27=11011
Explanation:
A decimal number is converted to binary number by constantly dividing the decimal number by 2 till the number becomes zero and then write the remainders in reverse order of obtaining them.Then we will get our binary number.
I will provide you 1 example:-
18/2 = 9 the remainder =0
9/2 = 4 the remainder =1
4/2 = 2 the remainder =0
2/2 = 1 the remainder =0
1/2 = 0 the remainder =1
Writing the remainder in reverse order 10010 hence it is the binary equivalent of 18.
Answer:
#include <string>
#include <iostream>
using namespace std;
int main() {
string userInput;
getline(cin, userInput);
// Here, an integer variable is declared to find that the user entered string consist of word darn or not
int isPresent = userInput.find("darn");
if (isPresent > 0){
cout << "Censored" << endl;
// Solution starts here
else
{
cout << userInput << endl;
}
// End of solution
return 0;
}
// End of Program
The proposed solution added an else statement to the code
This will enable the program to print the userInput if userInput doesn't contain the word darn
Answer:
To establish the BYOD policy is the correct answer to the following question.
Explanation:
<u>Implementation of the BYOD(Bring Your Own Device)</u>:
- Firstly, set you objectives and establish it.
- Then, you have to decide and tell your employees that what types of devices are only allowed in your organization.
- Then, establish your security policies related to the BYOD policy.
- Then, give good training by you or by the IT professionals to your employees.
- Finally, if the employee are leaving your organization then, you have to remove those employees from the BYOD policy by which they cannot access your company's informations.