Question: Ex-9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if the input is 692, the program should output
Ex-9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if the input is 692, the program should output 2,9, 6. Another example, if the number is 135429 the program should out put 9, 2, 4, 5, 3, and 1.


IMPORTANT: In Ex 9 to 12, you are not allowed to use strings. Instead, you should work with numbers and math operators, such as division, modulus, etc. Ex 9) Devise a flowchart to receive a positive number and output each digit separately. For instance, if the input is 692, the program should output 2, 9, 6. Another example, if the number is 135429 the program should out put 9, 2, 4, 5, 3, and 1. Ex 10) Devise a flowchart to receive a positive number and output how many of its digits are equal to 7. For instance, if the input is 772, the program should output 2, because there are two sevens there. Another example, if the input is 14368, the program should output 0. Ex 11) Devise a flowchart to receive a positive number and output sum of its digits. For instance, if the input is 63932, the program should output 23, because 6+3+9+3+2 is 23. Another example, if the input is 23 the program should output 5. Ex 12) Devise a flowchart to receive a positive number and output "yes" if it's equal to its reverse; otherwise, output "no". For instance, if the input is 63936, the program should output "yes", because if you read the digits from left to right or from right to left, it's the same number. But, if the input is 632, the program should output "no" because 632 is not the same as 236. Ex 13) Devise an algorithm to receive a positive number, as n, and output n! (n Factorial). 2 Ex 14) Devise an algorithm to input an integer greater than 1, as n, and output the first n values of the Fibonacci sequence. In Fibonacci sequence, the first two values are 0 and 1 and other values are sum of the two values preceding it. For instance, if the input is 4, the program should print 0, 1, 1, 2,. As another example, if the input is 9, the program should output 0, 1, 1, 2, 3, 5, 8, 13, 21, By the way, after you are done with Ex 14, learn more about applications of Fibonacci number in real life here: http://www.ijesi.org/papers/Vol(619/Version-3/80609030714.pdf. There might be a question on this in the pre-lab mini quiz. Ex 15) Devise an algorithm to input a positive integer, n,- and by using XX characters-output the figure below that has n rows and each row k has k pairs of XX. For instance, if input is 5, the figure on the left (and if the input is 12, the figure on the right) should be generated by the program. number: 5 XX XX XX XXXX XX number: 12 XX XX XX xx xx xx XXXXXXXX xxxxxxxxxx xxxxxxxxxxx XX XXXX XX xx xx xx xx xx xxx XXXXXXXXXX XXXX XX XX xx xx xx xx xx xx xx Show all your flowcharts to your TA before going to Part 2. The TAs may ask any teammate some questions about the flowcharts, they may also ask you to modify your flowcharts slightly. area start a, b, c a+b+c 2 -sqrt(s(s-a)(s-b)(s-c)) end "area: ", area pre: a, b, c ER post: area has to be outputted
Step by Step Solution
3.36 Rating (165 Votes )
There are 3 Steps involved in it
To devise a flowchart that outputs each digit of a positive number separately follow these ste... View full answer
Get step-by-step solutions from verified subject matter experts
