我如何能............................................... [英] How do I...............................................

查看:62
本文介绍了我如何能...............................................的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

核心Java编程评估

问题陈述

您的程序应该接受2个输入:

输入1:包含文本的段落/可以是几句话(输入结束用回车/回车标记)

输入2:一个数字,这将是0或1

处理:输入1可以有其中任意数量的以下单词分隔符:句号,逗号,分号

和空格。首先,将段落转换为小写。然后,将其中出现的单词及其出现次数制成表格。

Qutput IF输入2 = 0,然后按字母顺序升序显示单词及其出现次数

如果输入2 = 1,那么

显示单词及其出现次数,其出现次数的降序,即出现次数最多的单词应首先显示,接下来出现第二高的单词,依此类推。

注意:输出1中的单词不应该在输出中重复。

没有单词分隔符出现在输入1应存在于输出中。两个输入都应该在控制台中接受,一个接一个。

输出应写入控制台。

au coll cal ca

示例:输入1:这是一个段落。它包含单词,句子和分隔符。这段有单词,它包含三个句子。

当输入2 = 0时输入2 = 1

输出输出a 1和3和3包含2包含2它2有1段2是;句子2它2这2段2字2句子2 a 1分隔符1有1这2是1 3 1分隔符1个字2 3个1



什么我试过了:



没什么,没什么,什么都没有。

Core Java Programming Assessment
Problem Statement
Your program should accept 2 inputs:
Input 1: A paragraph containing text/ can be a few sentences (end of input is marked by carriage return/ Enter)
input 2: A number, this will be either 0 or 1
Processing : input 1 can have any number of the following word separators in it: full stop, comma, semi-colon
and blank space. First, convert the paragraph to lower case. Then, tabulate the words present in it along with the number of their occurrences.
Qutput IF Input 2 = 0, THEN Display the words and the number of their occurrences in the alphabetically ascending order
IF input 2 = 1, THEN
Display the words and the number of their occurrences the descending order of their number of occurences i.e. the word with the highest number of occurrences should be displayed first, the word with second highest occurrence next, and so on.
Notes:No word present in Input 1 should be repeated in the Output.
None of the word separators present in Input 1 should be present in the Output. Both inputs should be accepted in console, one after the other.
Output should be written to console.
au coll cal ca
Example:Input 1:This is a paragraph. It contains words, and sentences, and separators. This paragraph has words and it contains three sentences.
When Input 2 = 0 When Input 2 = 1
Output Output a 1 and 3 and 3 contains 2 contains 2 it 2 has 1 paragraph 2 is ; sentences 2 it 2 this 2 paragraph 2 words 2 sentences 2 a 1 separators 1 has 1 this 2 is 1 three 1 separators 1 words 2 three 1

What I have tried:

Nothing, nothing, nothing, nothing.

推荐答案

I想知道你的主题是什么!

I wondered what your subject line was all about!
引用:

我如何........ .......................................

How do I...............................................

告诉我们这个问题,所以我想,我只是建议他改进它,以便合适的人阅读并回答这个问题。



然后我看到其余的,很明显是什么小点代表:

Tells us nothing about the problem, so I thought, I'll just suggest he improve it so the right people read and answer the question.

And then I saw the rest, and it was obvious what the dots stood for:

引用:

我如何让别人为我做功课?

这里的任何人都可以回答:你没有。



我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但是我们不会为你做这一切!

And anyone here can answer that: you don't.

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


你是什么意思如何?分配说明正在为您拼写。



这项任务只不过是使用您已经教过的构建块。它只不过是获取输入,数组,for循环,if语句和输出。
What do you mean "how"? The assignment description is spelling it out for you.

This assignment is nothing more than using the building blocks you've already been taught. It's nothing more than getting input, arrays, for loops, if statements, and output.


Quote:

我怎么.............................................. 。

How do I...............................................



可能你应该和老师谈谈。



你没有尝试自己解决问题,毫无疑问,你的主要努力是粘贴要求,你只是希望我们做你的HomeWork。

HomeWork问题是你在现实生活中必须解决的问题的简化版本,他们的目的正在学习练习



我们不做你的HomeWork。

HomeWork不会测试你乞求别人做你的工作的技巧,它是让您思考并帮助您的老师检查您对所学课程的理解以及您应用这些课程时遇到的问题。

你的任何失败都会帮助你的老师发现你的弱点并设定补救措施。

你的任何失败都会帮助你了解什么有效,什么无效,被称为'试错'学习。

所以,试一试,重读课程并开始工作。如果您遇到特定问题,请显示您的代码并解释这个问题,我们可能会提供帮助。



作为程序员,您的工作是创建算法解决特定问题,你不能依赖别人永远为你做,所以有一段时间你必须学会​​如何。而且越快越好。

当你要求解决方案时,就像试图通过培训其他人来学习开车一样。

创建算法基本上是找到数学并做出必要的调整以适应你的实际问题。


May be you should have a talk with your teacher.

You show no attempt to solve the problem yourself, you have no question, your main effort is pasting the requirement, you just want us to do your HomeWork.
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.


这篇关于我如何能...............................................的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆