什么是最简单的GUI形式来完成这个(多少个按钮/文本框/标签) [英] What would be the simplest GUI form to accomplish this (how many buttons/ text boxes/labels)

查看:142
本文介绍了什么是最简单的GUI形式来完成这个(多少个按钮/文本框/标签)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于C#,创建一个名为TaxPayerDemo的程序,声明一个包含10个Taxpayer对象的数组。提示用户输入每个对象的数据并显示10个对象。纳税人对象的数据字段包括员工编号(使用类型的字符串,但不使用员工编号中的短划线),年度总收入和所欠的所得税。包含具有前两个数据字段的get和set访问器的属性,但将欠税权限设为只读属性。每当收入确定时,都应计算税额。假设30,000美元以下的收入税率为15%,30,000美元或更高的收入税率为28%。



我的尝试:



我手写的代码只是寻求如何创建GUI的指导。

解决方案

30,000或更高的收入为30,000%和28%。



我尝试过:



我手写的代码只是寻求如何创建GUI的指导。


最简单的用户界面不一定最好的:经常是相反的。

在这种情况下,最简单的UI是一个TextBox和一个按钮 - 但是从用户POV开始,它就是一个完整的PITA。



不要设计简单 - 可用性设计。让自己处于用户的位置,并考虑如何最舒适地使用它,而不是简单易用。



在这种情况下,问题仍然存在自己的回答:

Quote:

提示用户输入每个对象的数据并显示10个对象。



提示用户的要求意味着它必须是一个控制台应用程序,因为你没有提示用户输入GUI应用程序,无论是WinForms,WPF,UWP还是Web基于。

这意味着你的用户界面非常基本,包括Console.WriteLine和Console.ReadLine,其他很少......


For C#, Create a program named TaxPayerDemo that declares an array of 10 Taxpayer objects. Prompt the user for data for each object and display the 10 objects. Data fields for Taxpayer objects include the Employee number (use a string for the type, but do not use dashes within the Employee number), the yearly gross income, and the income tax owed. Include a property with get and set accessors for the first two data fields, but make the tax owed a read-only property. The tax should be calculated whenever the income is set. Assume that the tax rate is 15 percent for incomes under $30,000 and 28 percent for incomes that are $30,000 or higher.

What I have tried:

I have the code handwritten just seeking guidance on how I can create the GUI.

解决方案

30,000 and 28 percent for incomes that are


30,000 or higher.

What I have tried:

I have the code handwritten just seeking guidance on how I can create the GUI.


The simplest UI is not necessarily the best: often quite the reverse.
The simplest UI in this case is one TextBox and one button - but from a user POV it's a total PITA to use.

Don't design for "simplicity" - design for usability. Put yourself in the position on the user and think about how he will use it most comfortably, rather than what is simple to do.

In this case the question holds it's own answer:

Quote:

Prompt the user for data for each object and display the 10 objects.


The requirement to prompt the user implies it's got to be a console application, as you don't "prompt" the user for input in GUI applications, be they WinForms, WPF, UWP, or Web based.
That means your UI is going to be pretty basic, and consist of Console.WriteLine and Console.ReadLine and very little else ...


这篇关于什么是最简单的GUI形式来完成这个(多少个按钮/文本框/标签)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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