Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7. inputs a string and checks whether a certain character exists or doesnt exists on that string.
- Example Input/Output1:
- String: The quick brown fox jumps over the lazy dog.
- Find character: j
- Found character j on the string.
- Example Input/Output2:
- String: Python 3.7.0b
- Find character: p
- Couldnt find character p on the string.
- 8. inputs a string and checks whether a certain character (regardless of its case) exists or doesnt exists on that string.
- Example Input/Output1:
- String: high level language
- Find character: H
- Found character H on the string.
- Example Input/Output2:
- String: Guido van Rossum
- Find character: r
- Found character r on the string.
- 9. inputs a string and prints the location of a certain character from that string.
- Example Input/Output1:
- String: Smashing Pumpkins
- Check character position for: g
- Character g is positioned at: 8
- Example Input/Output2:
- String: Jose Rizal Memorial State University
- Find character: e
- Character e is positioned at: 4, 13, 25, 31
- Example Input/Output3:
- String: Microsoft
- Find character: h
- Couldnt find character h on the string.
- 10. inputs a string and prints the number of word(s), letter(s), upper cased letter(s), lower cased letter(s),
- number(s), and symbol(s) found on the string.
- Example Input/Output:
- String: Mr. Xs sons salary has dramatically increased by 30% on his 3rd month of his job as C++ developer.
- Word(s) found: 19
- Letter(s): 72
- Upper cased letter(s): 3
- Lower cased letter(s): 69
- Digit(s): 3
- Symbol(s): 7
- 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.
- Example Input/Output:
- String: Mr. Xs sons salary has dramatically increased by 30% on his 3rd month of his job as C++ developer.
- Letter(s): MrXssonssalaryhasdramaticallyincreasedbyonhisrdmonthofhisjobasCdeveloper
- Upper cased letter(s): MXC
- Lower cased letter(s): rssonssalaryhasdramaticallyincreasedbyonhisrdmonthofhisjobasdeveloper
- Digit(s): 303
- Symbol(s): .%++.
- 12. checks whether the password created by the user is acceptable or not acceptable and matched.
- Conditions to make it acceptable:
- ►Minimum length of 7 characters.
- ►Maximum length of 15 characters.
- ►Must contain at least 1 upper-cased and 1 lower-cased letters.
- ►Must contain at least 1 number.
- ►Must contain at least 1 symbol.
- Example Input/Output1:
- Create password: M@tchbox20
- Confirm password: M@tchbox20
- Success!
- Example Input/Output2:
- Create password: M@tchboxtwenty
- Confirm password: M@tchboxtwenty
- Invalid password format!
- Example Input/Output3:
- Create password: Str!k3
- Confirm password: Str!k3
- Password must have at least 7 characters.
- Example Input/Output4:
- Create password: M@tchboxtwentyse7en
- Confirm password: M@tchboxtwentyse7en
- Password should not exceed 15 characters.
- Example Input/Output5:
- Create password: Python3.7b
- Confirm password: Python3.7a
- Password mismatch!
- 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.
- Example Input/Output1:
- String: JosE RizaL MemOriaL StAte UniVersity
- Result: JOsE RIzAL MEmOrIAL StAtE UnIVErsIty
- Example Input/Output2:
- String: Pythn Prgrmmng Lngg
- Sorry, couldnt find any vowel on that string.
- 14. gets the product of two numbers without using * symbol. Using of predefined function/command is not allowed.
- Example Input/Output1:
- a: 7
- b: 7
- 7 x 7 = 49
- Example Input/Output2:
- a: -3
- b: 4
- -3 x 4 = -12
- 15. calculates x^y (x to the power of y) without using * symbol. Using of predefined function/command is not allowed.
- Example Input/Output1:
- X: 2
- Y: 3
- 2^3 = 8
- Example Input/Output2:
- X: 4
- Y: 4
- 4^4 = 64
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement