Write a program that takes a positive integer as input and prints its factorial. Write two separate functions, one that computes the factorial iteratively, and the other recursively.
What happens if the condition in a while loop is initially false? Explain and differentiate
between while and do while statement in ‘C’ language.
What is an expression? What are its components? Explain.
Write a program that takes as input a class score. Output the grade for the class based on the
following guideline:
Exactly 100 is A+
90and above is A
80 and above is B
70 and above is C
60 and above is D
Anything less than 60 is F
Anything more than 100 or less than 0 is invalid input.
Write a program that accepts a letter grade as input and outputs the teacher’s remarks. Use
only switch, do not use any if’s. Example: If ‘A’or ‘a’, then “Excellent job!”. If ‘F’ or ‘f’, then “You
failed. Please study more next time”.
String &Regular Expressions
Write a python script to take two string S1 and S2 and do the following:
Check S1 and S2 are anagrams or not.
Check S1 is Sub string of S2 or not.
S1 is palindrome or not
Imagine a collection of nuts and bolts that are all together in one pile on a table. Describe, in pseudocode, how you would find all matching pairs of nuts and bolts. You need to find one solution for each of the problem-solving approaches given below. For each of your solution, determine how many comparisons of pairs of nuts and bolts you might have to make in the best- and worst- case scenario. You can assume that there are complete pairs, no single nuts or bolts, and that for each bolt, there is exactly one nut that fits. Describe a solution to the nuts and bolts problem (in pseudocode) using a Divide and Conquer Approach.
Output all combinations of character variables a, b, and c, in the order shown below. If a = 'x', b = 'y', and c = 'z', then the output is:
xyz xzy yxz yzx zxy zyxImagine a collection of nuts and bolts that are all together in one pile on a table. Describe, in pseudocode, how you would find all matching pairs of nuts and bolts. You need to find one solution for each of the problem-solving approaches given below. For each of your solution, determine how many comparisons of pairs of nuts and bolts you might have to make in the best- and worst- case scenario. You can assume that there are complete pairs, no single nuts or bolts, and that for each bolt, there is exactly one nut that fits. Describe a solution to the nuts and bolts problem (in pseudocode) using a Brute Force Approach.
Ajayi bello applied for a bed space in the unity hall of residence but was not allocated for one, he later got an accomodation in apete through an agent he was asked to pay the following
(1) Rent of #36,000 per annum
(2) 5% caution fee
(3) 10% maintenance fee
(4) 5% legal fee
(5) 10% agency fee
Write a visual basic code to display the total amount that will pay for that year