Answer:
- def getCharacterForward(char, key):
- charList = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-
- if(len(char) > 1):
- return None
- elif(not isinstance(key, int)):
- return -1
- else:
- index = charList.find(char)
- if(index + key <= 25):
- return charList[index + key]
- else:
- return charList[(index + key)% 26]
-
- print(getCharacterForward("C", 4))
- print(getCharacterForward("X", 4))
Explanation:
Firstly, define a charList that includes all uppercase alphabets (Line 2). We presume this program will only handle uppercase characters.
Follow the question requirement and define necessary input validation such as checking if the char is a single character (Line 4). We can do the validation by checking if the length of the char is more than 1, if so, this is not a single character and should return None (Line 5). Next, validate the key by using isinstance function to see if this is an integer. If this is not an integer return -1 (Line 6 - 7).
Otherwise, the program will proceed to find the index of char in the charList using find method (Line 9). Next, we can add the key to index and use the result value to get forwarded character from the charList and return it as output (Line 11).
However, we need to deal a situation that the char is found at close end of the charList and the forward key steps will be out of range of alphabet list. For example the char is X and the key is 4, the four steps forward will result in out of range error. To handle this situation, we can move the last two forward steps from the starting point of the charList. So X move forward 4 will become B. We can implement this logic by having index + key modulus by 26 (Line 13).
We can test the function will passing two sample set of arguments (Line 15 - 16) and we shall get the output as follows:
G
B
Windows paint can be used to open a bitmap file. Usually, when you have a picture, you can use that to edit it.
Also, on a side note, notepad is specifically used for html codes.
Answer: Windows Paint
<u>I will advise Sara to do research about the problem on the Internet.</u>
<u>Explanation</u>:
Internet is a network that helps in connecting one computer with other globally. Communication between the computers is possible until the computers are connected with to the Internet. Internet helps in getting information from any computer and interacts with the users of the computer.
Sara finds some issue with her computer. She was troubleshooting, but she could not find the exact problem. She was not sure with the problem that she found. It is better for Sara to do research about her problem on Internet and find the solution.
Answer:
The answer is E, Social media information system.
Explanation:
What makes the answer unique is the fact that the system only supports information shared within a specific group of local network users.
By definition, Social media information system is an information technology tool that assists in the reversible distribution of information or digital content among people of like and similar network.
Answer:
B. Identify the most popular languages to determine the highest job demand.
Explanation:
You are not here to gain just experience or identify the language that is most compatible with various other languages for various skills. And these programming languages are standards, and hence you are not required to check them for turning completeness tests to meet various programming criteria. The correct option for you will be to identify the most popular languages to determine the highest job demand. And hence, B. is the right option for this question.