Tag Archives: #QUIZ09

solution for q4.cpp

This program has to ask the user for a word “string” and print out “true” in case, the word can be spelled backwards just as it would be spelled normaly (palindromes). If the inverse is different to the actual word, then the program needs to print out “false”.

here are some examples of palindromes:

ana
lol
sos
bob
mom
dad

In order to do this, we will ask the user for a string and use a function to reverse it (change the position of every letter) and compare it to the original word. For this to work, we have to make sure to include the correct libraries:

After having these libraries, we need to create 2 variables (strings) in order to receive the word, (two times in this case) and store its original value in the second string. After doing this, we will invert the word and compare it two the second variable (the original word is stored here) and check if it is indeed a palindrome or not. In order to do this, we will be using a function called reverse:

word= string(word.rbegin(), word.rend()); //where “word” is our variable to be inverted//

So the program should ask the user for a word, store it and then ask for it again (in order to keep the original value in a different variable). After doing this, it should use the function for reverse shown above and invert the initial variable. Using a “if, else” conditional, we can print out “true” or “false” depending if the conditional was proven:

if (word == newword){

cout<<” true “;

}else {

cout<<” false “;

}

//where word is the first variable and newword is the second one//

here is a picture of how the could should look and how it should run:

 

Quiz 09

Este programa muestra un triangulo de “T” dependiendo del valor que decees. 

https://github.com/eliotibg/Quiz09/blob/master/t.py

Quiz 09

Este programa calcula la distancia entre dos puntos. 

https://github.com/eliotibg/Quiz09/blob/master/distancia.py

Corrections of Quiz 09

Finally finish my work in the corrections of the exams 

ps… sorry for the delay it was quite difficult to me !! 

Here are the links:

Question 1 (Triangles): https://github.com/carolinarmtz/TC1017/blob/master/q1tri.cpp

Question 2 (Superpower): https://github.com/carolinarmtz/TC1017/blob/master/q2pow.cpp

Question 3 (Fibonacci): https://github.com/carolinarmtz/TC1017/blob/master/q3fib.cpp

Question 4 (Palindrome): https://github.com/carolinarmtz/TC1017/blob/master/q4pal.cpp

 

Quiz 9

Here is my corrected code for the final exam in Partial 2

Q1 Code

Q2 Code

Q3 Code

Q4 Code

Quiz #09

Here’s the link to the repository for Quiz09 https://github.com/alejanbreu/Quiz09 #Quiz09

Here's the link to the repository for Quiz09
https://github.com/alejanbreu/Quiz09

QUIZ 09

Ex1:https://github.com/PacoRoug/TC1014/blob/master/quiz%20%239%20ex1

Ex2: https://github.com/PacoRoug/TC1014/blob/master/quiz%20%239%20ex2.py

Ex3:https://github.com/PacoRoug/TC1014/blob/master/quiz%20%239%20ex3

Ex4:https://github.com/PacoRoug/TC1014/blob/master/quiz%20%239%20ex4

To do this exam, I just applied what we’ve learned in the semester: Range, lists, functions, etc.

I really didn’t remember how to do the first one, so I just improvised, and it worked (I’m a genius)

QUIZ 09

Quiz 9

Quiz 09

Quiz 9


Github link to exercise 1:

https://github.com/florethge/quizz/blob/master/ex1

Github link to exercise 2:

https://github.com/florethge/quizz/blob/master/ex2

Github link to exercise 3:

https://github.com/florethge/quizz/commit/427efd5270effa14ecd21b6d6471e3ceee79947c

Github link to exercise 4:

https://github.com/florethge/quizz/blob/master/ex4

Quiz 9

Quiz 09

Quiz 9


Github link to exercise 1:

https://github.com/florethge/quizz/blob/master/ex1

Github link to exercise 2:

https://github.com/florethge/quizz/blob/master/ex2

Github link to exercise 3:

https://github.com/florethge/quizz/commit/427efd5270effa14ecd21b6d6471e3ceee79947c

Github link to exercise 4:

https://github.com/florethge/quizz/blob/master/ex4