一些初学者帮助C# [英] Some beginner help with C#

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

问题描述

< 问题1 - 客户:创建一系列客户名称。 (对于此单元,您应将名字和姓氏存储在一个字段中,格式为Last_name,First_name。)使用4到6个客户名称填充数组,以非字母顺序输入名称。 (注意:为了练习接收用户输入并向程序添加元素,您将允许用户在程序运行时向阵列中添加一个客户。因此,您的阵列只需要比客户数量大一个项目您需要预先加载。显然,在生产程序中,您需要允许您的客户列表增长,最有可能使用数据库。)

•对于Customer数组,创建一个程序来演示以下任务:

o提示用户输入新的客户名称;将名称添加到数组(在空位置)。

o告诉用户数组中有多少客户名称。 (参见下面的编程说明中的注释#1。)

o按字母顺序对数组进行排序。

o打印排序结果。

o提示用户输入客户名称;如果名称在数组中,则打印出来;如果没有,请说明。继续提示用户搜索更多用户名,直到用户表明他们不再想要搜索更多名称。 (您可以选择用户指示此方式的方式,是否输入结束或您决定的其他内容。确保告知用户如何使用您的程序!)



问题2 - 船只滑动:创建一个数字数组,表示滑动数字。

•对于Boat Slip数组,创建一个程序来演示以下任务:

o用一些数字填充数组。 (注意:在定义并最初填充后,套牌号阵列不需要增长或增加。)

o提示用户提供要搜索的单号;如果数字在数组中,则打印出来;如果没有,请说明。

o向用户表明(而不是搜索一张单据)他们可以打印出所有单号的列表;如果他们愿意,告诉他们如何操作。

o继续提示用户输入更多的单号以进行搜索,直到用户表明他们不想再搜索。 (您可以选择用户指示此方式的方式,是否输入结束或您决定的其他内容。确保告知用户如何使用您的程序!)



问题3 - 滑动租借:创建一个数字数组,表示每个单据租用的金额(每月)。使用一些美元金额(两位小数)填充数组。 (注意:滑动量数组在定义并最初填充后不需要增长或增加;但是,它应该具有与上面的船形数字数组相同的条目数。)

•对于Slip Rental阵列,创建一个程序以演示以下任务:

o打印以货币格式显示的每月租金金额。

o以货币格式显示所有单据租用的总金额(即数组中所有数字的总和)。 (请参阅下面的编程说明中的注释#2。)

o(对于本练习,滑动租赁金额不需要与滑动编号相关联。)

解决方案

对不起,这里的'快速回答'(这个名字是一个提示)我们不做你自己的功课。

开始编码并在遇到问题时询问具体问题。

请阅读常见问题解答 [ ^ ]。

Slip Rental Amnt:创建一个数字数组,表示每个单据租用的金额(每月)。


<Problem1 - Customers: Create an array of customer names. (For this Unit, you should store first and last names in one field, in the format "Last_name, First_name".) Populate the array with 4 to 6 customer names, entering the names in "non-alphabetical" order. (Note: In order to practice receiving user-input and adding elements to your program, you will allow the user to add one customer to your array when your program runs. Thus your array only needs to be one item larger than the number of customers you pre-load. Obviously in a production program you would need to allow your customer list to grow, most likely using a database.)
•For the Customer array, create a program to demonstrate the following tasks:
o Prompt the user for a new customer name; add the name to the array (in an empty location).
o Tell the user how many customer names are in the array. (See Note #1 in Programming Notes below.)
o Sort the array alphabetically.
o Print the sorted results.
o Prompt the user for a customer name to search for; if the name is in the array, print it; if not, indicate so. Continue prompting the user for more user names to search for until the user indicates they no longer want to search for any more names. (You choose the way for the user to indicate this, whether they enter the word "end" or something else you decide on. Make sure you inform the user how to use your program!)

Problem2 - Boat Slips: Create an array of numbers, representing slip numbers.
• For the Boat Slip array, create a program to demonstrate the following tasks:
o Populate the array with some numbers. (Note: the slip number array will not need to grow or have additions after it is defined and initially populated.)
o Prompt the user for a slip number to search for; if the number is in the array, print it; if not, indicate so.
o Indicate to the user that (rather than searching for one slip) they can print out a list of all slip numbers; tell them how and do so if they choose to.
o Continue prompting the user for more slip numbers to search for until the user indicates they no longer want to search. (You choose the way for the user to indicate this, whether they enter the word "end" or something else you decide on. Make sure you inform the user how to use your program!)

Problem3 - Slip Rental Amnt: Create an array of numbers, representing the amount each slip is rented for (monthly). Populate the array with some dollar amounts (with two decimal places). (Note: the slip amounts array will not need to grow or have additions after it is defined and initially populated; however, it should have the same number of entries as the boat slip number array above.)
•For the Slip Rental array, create a program to demonstrate the following tasks:
o Print out each of the monthly rental amounts shown in currency format.
o Display the total amount that all slips rent for (i.e. sum of all numbers in the array) in currency format. (See Note #2 in Programming Notes below.)
o (For this exercise, slip rental amounts do not yet need to be associated with a slip number.)

解决方案

Sorry, here at 'Quick Answers' (the name is a hint) we don't do your own homework.
Start coding and ask here specific questions whenever you get stuck.
Please read the FAQ[^].


Slip Rental Amnt: Create an array of numbers, representing the amount each slip is rented for (monthly).


这篇关于一些初学者帮助C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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