注册 登录
查看: 2578|回复: 0
打印 上一主题 下一主题

英文作业:输入一句话对英文单词进行处理

[复制链接]

该用户从未签到

3524

主题

3538

帖子

67万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
673178
QQ
跳转到指定楼层
楼主
发表于 2018-10-15 19:55:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Assignment #5
Problem Description
Design and implement a java application that reads a sentence (one line of text) from the user, it then displays a menu for different tasks.
The following is a screen sample of the program:
Please enter a sentence:
A digital computer stores information as numbers (1234).
Please enter:
1. To display the number of words in the sentence.
2. To display the number of vowel characters in the sentence.
3. To display the word with the most number of characters.
4. To display the word with the most vowels.
5. To enter a new statement.
6. To terminate the program.
1
There are 8 words in “A digital computer stores information as numbers (1234).”
Please enter:
1. To display the number of words in the sentence.
2. To display the number of vowel characters in the sentence.
3. To display the word with the most number of characters.
4. To display the word with the most vowels.
5. To enter a new statement.
6. To terminate the program.
2
There are:
        4 a’s
        3 e’s
        4 i’s
        4 o’s
        2 u’s
in “A digital computer stores information as numbers (1234).”
Please enter:
1. To display the number of words in the sentence.
2. To display the number of vowel characters in the sentence.
3. To display the word with the most number of characters.
4. To display the word with the most vowels.
5. To enter a new statement
6. To terminate the program.
3
The longest word is:  information
Please enter:
1. To display the number of words in the sentence.
2. To display the number of vowel characters in the sentence.
3. To display the word with the most number of characters.
4. To display the word with the most vowels.
5. To enter a new statement
6. To terminate the program.
4
The word with the most vowels is: information
Please enter:
1. To display the number of words in the sentence.
2. To display the number of vowel characters in the sentence.
3. To display the word with the most number of characters.
4. To display the word with the most vowels.
5. To enter a new statement
6. To terminate the program.
5
Please enter a new statement:
   Java is an Object-Oriented computer programming language.
Please enter:
1. To display the number of words in the sentence.
2. To display the number of vowel characters in the sentence.
3. To display the word with the most number of characters.
4. To display the word with the most vowels.
5. To enter a new statement
6. To terminate the program.
6
Program terminates
Notes:
· Use the Scanner nextLine method to read the sentence from the user.
· Create a method for each task.
· In your main method read the sentence from the user, then display the menu, and use a switch statement to call appropriate method for each task.
· The program should be repeated until the user enters 6 to terminate.
Marking Scheme
[2 marks] Presentation/Style: Organization, readability, descriptive
                           identifier, indentation, bracket placement.
[16 marks] Correctness: Program works without bugs.
[2 marks] Documentation: Internal
此源码经过详细测试 保证能运行!!!

运行视频:

https://pan.baidu.com/s/14vTNjxwSlIvgwG1h43Ttjw

下载地址:
游客,本付费内容需要支付 50金币 才能浏览支付

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
java无忧网(http://www.javawyw.com),专业提供Java大作业,小作业,课程设计,毕业设计源码,答辩辅导,作业排错,bug修复,专业解答,远程部署运行项目等服务
本网站所有源码,保证能运行!
QQ:1399491757
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回列表 返回顶部