Question: It needs to be in Python and not another programming language. 1. Write the pseudo-code of an algorithm that reads a list of numbers form
It needs to be in Python and not another programming language.
1. Write the pseudo-code of an algorithm that reads a list of numbers form the user and prints the number of zeroes in the list. As an example if the program reads X = [1, 0, 2, 0, 3, 0], the algorithm should print the number 3.
2. Write the pseudo-code of an algorithm that reads two lists of numbers form the user and prints TRUE if the lists are equal, and FALSE if not. Assume that both lists are of the same length. As an example if the algorithm reads X = [1, 0, 2, 0, 3, 0] and Y = [1, 0, 3, 2, 3, 0], the algorithm should print FALSE.
3. Write the pseudo-code of an algorithm that reads a list of numbers containing the final grades of a given group of students in some course (on a 100-point scale). The algorithm should print a list with the corresponding letter grade for each student. As an example if the algorithm reads [93.2, 69.8, 78.3, 82.6, 95.1, 59.4], the output should be [A C, C, B, A, F].
4. Write the pseudo-code of an algorithm that reads a positive integer as an input and prints a list with its digits. For instance, if the user enters 234, the algorithm should print the list [2, 3, 4].
5. Write the pseudo-code of an algorithm that reads (1) a list X of length n, and (2) a list Y of length m n. Assume that Y is populated with all different integers between 0 and n-1. The algorithm should print the sum of the elements in X with indexes (i.e. indexed) in Y. For instance, if X = [1, 3, 2, 6, 3, 9, 7, 5] and Y = [0, 3, 6, 2]: the algorithm should print X0 + X3 + X6 + X2 = 1 + 6 + 7 + 2 = 16.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
