#Quiz09

Question 1

This is the link for question number 1:

https://github.com/taniaprogram/SolvingProblemsWithProgramming/blob/master/q1p2.cpp

I did not modify anything.

Question 2

This is the link for question number 2:

https://github.com/taniaprogram/SolvingProblemsWithProgramming/blob/master/q2p2.cpp

I did not modify anything.

Question 3

This is the link for question number 3:

https://github.com/taniaprogram/SolvingProblemsWithProgramming/blob/master/q3p2.cpp

In the exam I used recursion, but the asked way to solve this was looping. My original program had a bug that I deleted changed a number in the for loop. So, the correct way to execute the loop for is, until i<=n-2. Before doing this the program works in the correct way.

Question 4

This is the link for question number 4:

https://github.com/taniaprogram/SolvingProblemsWithProgramming/blob/master/q4p2.cpp

In the exam, this program did not compile, my logic was right but my code was not write in the correct way. Then I realized that I did not declare the string in the correct way. Now my program runs, but it has a bug that I could not solve. If the word has zero or one letter, the program prints “Es palindromo”, and this is correct; if the word has more than one letter, the program prints “No es palíndromo”, so, this is the problem, because there is a possibility that the word is palindrome.

CC BY 4.0 #Quiz09 by Tania Pardo is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.