1.Read the following paragraph as quickly as you can and see if you encounter any difficulties:
Aoccdrnig to rscheearch at an Elingsh uinervtsy, it deosn’t mttaer in waht ordedr the ltteers in a wrod are, the olny thing is taht the frist and lsat ltteer is at the rghot pclae. The rset can be a toatl mses and you can still raed it wouthit a porbelm. Tihs is bcuseae we do not raed ervey lteter by itself but the wrod as a wlohe.
This paragraph was published as an example of a principle of human reading comprehension If you keep the first letter and the last letter of a word in their correct positions and scramble the letters in between, the word is still quite readable in the context of a surrounding paragraph. However, it seems that this is a bit of a myth and not truly based on solid research. It turns out that for longer words, the task is much more difficult. Nonetheless, we are going to imitate the process on some English text.
For this project you will need to write a program that will take a sentence as user input and print the sentence with the words scrambled, just as the paragraph above.
Handling punctuation is tricky. You need to deal with punctuation that comes at the end of a word: comma, period, question mark, exclamation, and so on. For example, in the previous sample, the word university ends with a comma, so you need to ensure that you do not treat the comma as the last letter of the word when you scramble all but the first and last letters.
Hints:
2.How thick does paper folding get? Take one sheet of paper out of your newspaper, and fold it in half, then fold it in half again, and again, and again. Can you fold it 30 times? Pretending that you can (you probably cant fold it more than eight times), how thick would it be after 30 times? Assume the paper is 1/200 cm thick. Write a program to solve this puzzle. Prompt the user for the number of folds and output the thickness in meters. For example: if the number of folds entered was 10, then the program would print that the paper has a thickness of 4.8828E-8 meters.
3.What is the invention of chess worth?
There is a popular myth about the man who invented chess. The local ruler was so pleased with the invention that he offered the inventor a great reward in gold. The inventor suggested an alternative reward: he would get one grain of wheat on the first square of the chess board, two grains on the second square, four on the third, eight on the fourth, sixteen on the fifth, and so on, doubling the number of grains each time. The ruler saw that this must be a much better deal for him, and accepted. The board has 64 squares. Write a program to determine the following: