Answer:
The algorithm is as follows:
Step 1: Start
Step 2: Parties = [All delegates in the party]
Step 3: Lent = Count(Parties)
Step 4: Individual = 0
Step 5: Index = 1
Step 6: For I in Lent:
Step 6.1: If Parties[Individual] == Parties[I]:
Step 6.1.1: Index = Index + 1
Step 6.2: Else:
Step 6.2.1 If Index == 0:
Step 6.2.2: Individual = I
Step 6.2.3: Index = 1
Step 7: Else
Step 7.1: Index = Index - 1
Step 8: Print(Party[Individual])
Step 9: Stop
Explanation:
The algorithm begins here
Step 1: Start
This gets the political parties as a list
Step 2: Parties = [All delegates in the party]
This counts the number of delegates i.e. the length of the list
Step 3: Lent = Count(Parties)
This initializes the first individual you come in contact with, to delegate 0 [list index begins from 0]
Step 4: Individual = 0
The next person on the list is set to index 1
Step 5: Index = 1
This begins an iteration
Step 6: For I in Lent:
If Parties[Individual] greets, shakes or smile to Party[i]
Step 6.1: If Parties[Individual] == Parties[I]:
Then they belong to the same party. Increment count by 1
Step 6.1.1: Index = Index + 1
If otherwise
Step 6.2: Else:
This checks if the first person is still in check
Step 6.2.1 If Index == 0:
If yes, the iteration is shifted up
Step 6.2.2: Individual = I
Step 6.2.3: Index = 1
If the first person is not being checked
Step 7: Else
The index is reduced by 1
Step 7.1: Index = Index - 1
This prints the highest occurrence party
Step 8: Print(Party[Individual])
This ends the algorithm
Step 9: Stop
The algorithm, implemented in Python is added as an attachment
Because there is an iteration which performs repetitive operation, the algorithm running time is: O(n)
Rupesh wants to try programming with Eclipse. What is the first step he should take to make that happen?
download the Eclipse IDE
download the current Java Development Kit
create a restore point
disable his security program
Answer:
create a restore point
Explanation:
PLEASE SOMEONE ANSWER THIS
If the old code to a passcode was 1147, and someone changed it, what would the new code be?
(I already tried 4117)
[I forgot my screen time passcode please someone help I literally can’t do anything on my phone.]
Answer:
Any of these?
Explanation:
1147. 4117. 7411
1471. 4171
1714. 4711
1741. 7114
1417. 7141
Answer:
1417
Explanation:
Which of the following characterizes how an enabled security program might react to a new program installation on a computer system?
It might alert you to space requirement excesses.
It might report an error or tell you that the file is corrupted.
It might protect the new installation from getting viruses.
It might automatically set a restore point for the computer system.
Answer:
It might automatically set a restore point for the computer system
Answer:
It might report an error or tell you that the file is corrupted.
Explanation:
Write a function charInWord that takes in two parameters, a char (character) and a word (string). The program will return true if the character is in the word and false if it is not. If word is not a string type, or if char is not a string type, or if the length of char is greater than 1, the function should return None. Your main program should call the function and print char is in word if the function returns true, or char is not in word if the function returns false, using the user-supplied values instead of char and word. The program should print incorrect input provided if the function returns None. Ex: If the input is: a cat the output is: a is in cat Ex: If the input is: a club the output is: a is not in club Ex: If the input is: ab horse the output is:
Answer:
The program in Python, is as follows:
def charInWord(chr,word):
if len(chr)>1:
print("None")
elif not(chr.isalpha() and word.isalpha()):
print("None")
else:
if word.find(chr) == -1:
print(chr+" is not in "+word)
else:
print(chr+" is in "+word)
chr = input("Character: ")
word = input("Word: ")
print(charInWord(chr,word))
Explanation:
This defines the function
def charInWord(chr,word):
This checks if the length of character is greater than 1
if len(chr)>1:
If yes, it prints None
print("None")
This checks if the character or the word contains invalid character
elif not(chr.isalpha() and word.isalpha()):
If yes, it prints None
print("None")
This is executed for valid parameters
else:
If the character is not present, this is executed
if word.find(chr) == -1:
print(chr+" is not in "+word)
If the character is present, this is executed
else:
print(chr+" is in "+word)
The main begins here
This gets the character
chr = input("Character: ")
This gets the word
word = input("Word: ")
This calls the method and prints the required output
print(charInWord(chr,word))