c#
文章平均质量分 66
edward_faint
这个作者很懒,什么都没留下…
展开
-
编写一个控制台应用程序,给字符串中的每一个单词加上双引号.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _5_5_7 { class Program { static void Main(string[] args) { string s原创 2012-09-30 03:14:38 · 1141 阅读 · 0 评论 -
11_5_3给people添加GetOldest()方法,使用上面定义的重载运算符,返回一个Age最大的对象数组
//file Person.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace _11_5_1 { class Person : CollectionBase { pr原创 2012-10-25 04:49:06 · 861 阅读 · 0 评论 -
11_5_2扩展上一题中的Person 类,重载>、<、>=和<=运算符,比较Person实例的Age属性
//file Person.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _11_5_1 { class Person { private string name; private int age;原创 2012-10-24 16:25:47 · 964 阅读 · 0 评论 -
11_5_1创建一个集合类People ,它是下述Person类的集合,该集合中的项可以通过一个字符串索引符来访问,该字符串索引符是人的姓名,与Person.Name 属性相同:
//file Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _11_5_1 { class Program { static void Main(string[] args) {原创 2012-10-24 16:06:16 · 2401 阅读 · 0 评论 -
10_9_5为Ch10CardLib库编写一个控制台客户程序,从扰乱的Deck对象中一次取出5张牌.如果这5张牌都是相同的花色,客户程序就应在屏幕上显示这5张牌,以及文本"Flush",否则就显示50
//file name Suit.Cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Ch10CardLib { public enum Suit { Club, //梅花 Diamond,原创 2012-10-10 01:35:44 · 3330 阅读 · 0 评论 -
10_9_2从类MyClass中派生一个类MyDervedClass,重写GetString(),使用该方法的基类实现代码从基类中返回一个字符串,但在返回的字符串中添加文本"(output fro)"
//file name MyClass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _10_9_1 { class MyClass { private string myString; publ原创 2012-10-08 22:51:02 · 1142 阅读 · 0 评论 -
10_9_1编写代码,定义一个基类MyClass,其中包括虚礼方法GetString(),这个方法返回存储在受保护字段myString中的字符串,该字段可以通过只写公共属性ContainedStrin
//file name MyClass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _10_9_1 { class MyClass { private string myString; publ原创 2012-10-08 22:44:56 · 2464 阅读 · 0 评论 -
10_9_4编写一个类MyCopyableClass,该类可以使用方法GetCopy()返回它本身的一个副本.这个方法应使派生与System.Object的MemberwiseClose()方法.该类
//file name MyCopyableClass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _10_9_4 { class MyCopyableClass : System.Object { privat原创 2012-10-09 02:18:26 · 1094 阅读 · 0 评论 -
9_9_4在类库项目Vehicles中编写代码,执行本章前面讨论的对象系列Vehicle,
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _9_9_4 { //定义Vehicle基类 public abstract class Vehicle { string name; public原创 2012-10-05 05:03:40 · 760 阅读 · 0 评论 -
9_9_5创建一个控制台应用程序项目Traffic,它引用Vehicles.dll
//Vehicles.dll using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _9_9_4 { //定义Vehicle基类 public abstract class Vehicle { string name;原创 2012-10-05 05:18:13 · 585 阅读 · 0 评论 -
6_8_2编写一个应用程序,该程序使用2个命令行参数,分别把值放在一个字符串和一个整形变量中,然后显示这些值
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _6_8_2 { class Program { static void Display(string str, int num) {原创 2012-10-01 20:51:09 · 2215 阅读 · 0 评论 -
6_8_5在order结构体中添加一个函数.该结构体返回一个格式化的字符串,以合适的值替换用尖括号扩起来的条目
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _6_8_5 { class Program { struct order { public string itemName;原创 2012-10-02 01:57:20 · 696 阅读 · 0 评论 -
6_8_4修改下面的结构体,使之包含一个返回订单总价格的函数.
/* 函数 * struct order * { * public string itenName; * public int unitCount; * public double unitCost; * } */ using System; using System.Collections.Generic; using System.Linq原创 2012-10-02 01:27:13 · 713 阅读 · 0 评论 -
6_8_3创建一个委托,在请求用户输入时,使用它模拟Console.ReadLine()函数
using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace _6_8_3 { class Program { //创建 一个delegate delegate string ProcessDelegate(原创 2012-10-02 00:37:04 · 1305 阅读 · 0 评论 -
c# 链接sql server
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlClient; namespace testConnectionSqlServer { class Program { static void Main原创 2014-02-27 12:32:29 · 675 阅读 · 0 评论