Advertisement
Mingming00

Untitled

Dec 15th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. 7. inputs a string and checks whether a certain character exists or doesnt exists on that string.
  2. Example Input/Output1:
  3. String: The quick brown fox jumps over the lazy dog.
  4. Find character: j
  5.  
  6. Found character j on the string.
  7.  
  8. Example Input/Output2:
  9. String: Python 3.7.0b
  10. Find character: p
  11.  
  12. Couldnt find character p on the string.
  13.  
  14. 8. inputs a string and checks whether a certain character (regardless of its case) exists or doesnt exists on that string.
  15.  
  16. Example Input/Output1:
  17. String: high level language
  18. Find character: H
  19.  
  20. Found character H on the string.
  21.  
  22. Example Input/Output2:
  23. String: Guido van Rossum
  24. Find character: r
  25.  
  26. Found character r on the string.
  27.  
  28. 9. inputs a string and prints the location of a certain character from that string.
  29.  
  30. Example Input/Output1:
  31. String: Smashing Pumpkins
  32. Check character position for: g
  33.  
  34. Character g is positioned at: 8
  35.  
  36. Example Input/Output2:
  37. String: Jose Rizal Memorial State University
  38. Find character: e
  39.  
  40. Character e is positioned at: 4, 13, 25, 31
  41.  
  42. Example Input/Output3:
  43. String: Microsoft
  44. Find character: h
  45.  
  46. Couldnt find character h on the string.
  47.  
  48. 10. inputs a string and prints the number of word(s), letter(s), upper cased letter(s), lower cased letter(s),
  49. number(s), and symbol(s) found on the string.
  50.  
  51. Example Input/Output:
  52. String: Mr. Xs sons salary has dramatically increased by 30% on his 3rd month of his job as C++ developer.
  53.  
  54. Word(s) found: 19
  55. Letter(s): 72
  56. Upper cased letter(s): 3
  57. Lower cased letter(s): 69
  58. Digit(s): 3
  59. Symbol(s): 7
  60.  
  61. 11. inputs a string and prints all the letter(s), upper cased letter(s), lower cased letter(s), number(s), and symbol(s) found on the string.
  62.  
  63. Example Input/Output:
  64. String: Mr. Xs sons salary has dramatically increased by 30% on his 3rd month of his job as C++ developer.
  65.  
  66. Letter(s): MrXssonssalaryhasdramaticallyincreasedbyonhisrdmonthofhisjobasCdeveloper
  67. Upper cased letter(s): MXC
  68. Lower cased letter(s): rssonssalaryhasdramaticallyincreasedbyonhisrdmonthofhisjobasdeveloper
  69. Digit(s): 303
  70. Symbol(s): .%++.
  71.  
  72. 12. checks whether the password created by the user is acceptable or not acceptable and matched.
  73. Conditions to make it acceptable:
  74. ►Minimum length of 7 characters.
  75. ►Maximum length of 15 characters.
  76. ►Must contain at least 1 upper-cased and 1 lower-cased letters.
  77. ►Must contain at least 1 number.
  78. ►Must contain at least 1 symbol.
  79.  
  80.  
  81. Example Input/Output1:
  82. Create password: M@tchbox20
  83. Confirm password: M@tchbox20
  84.  
  85. Success!
  86.  
  87. Example Input/Output2:
  88. Create password: M@tchboxtwenty
  89. Confirm password: M@tchboxtwenty
  90.  
  91. Invalid password format!
  92.  
  93.  
  94. Example Input/Output3:
  95. Create password: Str!k3
  96. Confirm password: Str!k3
  97.  
  98. Password must have at least 7 characters.
  99.  
  100. Example Input/Output4:
  101. Create password: M@tchboxtwentyse7en
  102. Confirm password: M@tchboxtwentyse7en
  103.  
  104. Password should not exceed 15 characters.
  105.  
  106. Example Input/Output5:
  107. Create password: Python3.7b
  108. Confirm password: Python3.7a
  109.  
  110. Password mismatch!
  111.  
  112.  
  113. 13. inputs a string and converts all lower-cased vowels found on that string into upper case. If no vowel is found then it prints Sorry, couldnt find any vowel on that string.
  114.  
  115. Example Input/Output1:
  116. String: JosE RizaL MemOriaL StAte UniVersity
  117. Result: JOsE RIzAL MEmOrIAL StAtE UnIVErsIty
  118.  
  119. Example Input/Output2:
  120. String: Pythn Prgrmmng Lngg
  121. Sorry, couldnt find any vowel on that string.
  122.  
  123.  
  124. 14. gets the product of two numbers without using * symbol. Using of predefined function/command is not allowed.
  125.  
  126. Example Input/Output1:
  127. a: 7
  128. b: 7
  129.  
  130. 7 x 7 = 49
  131.  
  132. Example Input/Output2:
  133. a: -3
  134. b: 4
  135.  
  136. -3 x 4 = -12
  137.  
  138.  
  139. 15. calculates x^y (x to the power of y) without using * symbol. Using of predefined function/command is not allowed.
  140.  
  141. Example Input/Output1:
  142. X: 2
  143. Y: 3
  144.  
  145. 2^3 = 8
  146.  
  147. Example Input/Output2:
  148. X: 4
  149. Y: 4
  150.  
  151. 4^4 = 64
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement