⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 question.txt

📁 简单的文字处理,可以对输入的英文语句进行大小写变化,搜索所需要的英文字母在此句中出现的次数
💻 TXT
字号:
ex8a exercise Encrypt: Strings Exercise
=======================================


Problem specification
=====================

Given a sentence containing words, you need to convert it into uppercase and then
lowercase. Finally, report how many times each vowel is found in that sentence.
Finally you are to replace the occurances of certain letters in the sentence.


Method 
======

Use UserInput.readString() to grab the sentence that the user types. Then, convert it
to uppercase and print your result. Afterwards, convert it to lowercase and also
print your result. Finally, calculate how many times the vowels 'a', 'e', 'i', 'o' and 'u'
occur in the sentence, and print your result. See "Typical Input" and "Corresponding Output"
and adhere to the format specified.  You are then to replace the occurance of the letter
'e' or 'E' with the '$' symbol and also the occurance of 's'or 'S' with the '!' symbol and
print the message in lowercase only.


Error conditions
================

In this simple exercise, you don't have to consider an error condition if an invalid
input is given. However, you CANNOT assume a maximum sentence length. The length is 
arbitrary and will be at least 1 character. Therefore, usage of arrays is NOT recommended,
because arrays do assume a maximum length.


Hints
=====

Use the toUpperCase() and the toLowerCase() methods that are found in the String class
in order to make your life easier. Use String's charAt(i) method to "grab" a character
which occurs at position "i" inside a String.  The java API may be able to help
you with a method to replace characters.


Notes
=====

Constant values should be declared as final and static.


Typical input
=============

	Enter a sentence: The Cat Sat On The Mat


Corresponding output
====================

	The sentence entered is: The Cat Sat On The Mat
	The sentence in uppercase is: THE CAT SAT ON THE MAT
	The sentence in lowercase is: the cat sat on the mat
	'a' was found 3 times
	'e' was found 2 times
	'i' was found 0 times
	'o' was found 1 times
	'u' was found 0 times
	th$ cat !at on th$ mat


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -