Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write recursive functions (you are not allowed using for or while loops) to solve the following problems:


-Write a function that prints hello for 500 times

-x in power y ( )

-Geometric progression with common ratio r. For example, the sequence 2, 6, 18, 54, ... is a geometric progression with common ratio 3


Sum of the series



Write a program to find the sum



S of the series where S = x - x^3 + x^5 + ....... upto N terms.



Sample Input 1


2


5


Sample Output 1


410



to solve this approch


if i value is even:


result = summation of the term value and then added to the result



else :


result = Subtraction of the term value and then added to the result

Multiple of 3:


(1) Input: 6 Output: 3

1 9

2 6

3

5

9

6


(2) Input: 4 Output: 3

1 6

3

6

8


Multiple of 5 :


(1) Input: 6 Output: 1

1 2

2 3

3

5

9

6


(2) Input: 5 Output: 1

1 2

2 3

3 4

4

5


First Prime Number:


(1) Input: 5 Output: 3

1

10

4

3

2


(2) Input: 4 Output: 2

2

3

5

7


Composite Numbers in the range:


(1) Input: 2 Output: 4

9 6

8

9


(2) Input: 1 Output: 4

4


Write a program that will create a list of four animals, and will use a For loop to print out each of the animals in the list. First write an algorithm in the online editor below.


given an integer N write program which reads N inputs and prints the product of the given integers

2 3 7


B. Create a program using Python programming language that counts election vote for a president. Your program should display first the list of people who are running for president, after which your program should ask the user for his/her vote (based on number). There should be a total of 20 voters. After entering the votes of 20 voters, your program should display the winner including the number



29 / 29



of votes. It should also display the second, third until last place including the number of votes they have. Used for loop and if, elif, else statement on your program. Apply iter() and next() methods on your program. Use list in storing the votes. Observed correct variab le names.




A .Using Python programming language, create a program that allows the user to compute for his/her fare using the information below;







0-5km = P20.00






6-10km = P30.00






11-15km = P40.00








The bus only travels within the province, so the distance does not exceed from 15 kilometers. Your program should ask the user for distance travelled, and your program will compute and display the fare.








Use the If, elif, else statement on your program. Select appropriate data type and create appropriate variable names for your program.











LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS