在初学者的作业分配方面需要帮助 [英] Need Help with Beginner's Homework Assignment

查看:84
本文介绍了在初学者的作业分配方面需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您将创建一个包含单个表单的Windows应用程序.该表单将具有三个控件,一个文本框,一个显示文本"Parse"的按钮和一个合适的UI控件(最好是可滚动的),用于显示结果.输入文本并单击解析"按钮后,程序应输出字母中每个字母在文本框中出现的次数.不需要区分大小写.
例如,如果用户输入"baaad"作为文本并单击分析"按钮,则结果控件应显示:
有3个A 有1个B 有0个C's
有1个D's
有0个E's
有0个F's
等...

>这是我的家庭作业..哈哈首先让我说我迷路了!!!!

我想我想出了如何从第一个文本框中输入的文本ive中获取正确的计数...但是我不知道如何正确显示有3个A"等等...在结果控件中...


在此先感谢您

You are to create a Windows application that contains a single form. The form will have three controls, a textbox, a button displaying the text "Parse" and a suitable UI control, preferably scrollable, used to display the results. After entering the text and clicking the Parse button, the program should output the number of times each letter in the alphabet occurs in the textbox. Case sensitivity is not required.
For example, if the user enters "baaad" as the text and hits the Parse Button, the result control should display:
There are 3 A''s
There are 1 B''s
There are 0 C''s
There are 1 D''s
There are 0 E''s
There are 0 F''s
etc...

This my my homework assignment.. Lol First let me say that im Lost!!!!!

I think i figured out how to get the correct count out of the text ive entered in the first textbox... But i dont know how to get it to correctly display "There are 3 A''s" etc... in the result control...


Thank You in Advance

推荐答案

那应该没事,您必须丢失
That should be fine, you must be missing something.


好,这是功课,所以我不会给您任何代码示例!

对于字符串中的每个字符(c),都应增加一个由26个整数组成的数组,具体取决于字母表中的哪个字母.

然后循环执行26次,写有{n}个{c}",其中{n}是整数数组,{c}是字母.

将它们写到一个接受多行的文本框中,您已完成.

Ok, this is homework, so I''ll give you no code example!

for each character (c) in the string increment a count in an array of 26 integers depending on which letter of the alphabet it is.

Then go around a loop 26 times, writing "there are {n} {c}''s" where {n} is the integer from the array, and {c} is the letter.

Write these into a text box which will accept multiple lines, and you are done.


这篇关于在初学者的作业分配方面需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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