本人计算机编程初学者,在国外学习,给的作业不知如何入门求大神解读

以下是题目联系 求大神指导一二

此问题如何进行编写

            The TextBook class.

Fields (Instance Variables):
The class should have three private fields: one of type String to represent the title of the text book, one of type int to represent the length of the book in chapters, and one of type int to represent the number of the last chapter to be read (i.e. the number of chapters read so far).
Constructor Method:
The class should provide a constructor method with two parameters, one of type String and the other of type int. The first parameter represents the title of the book and the second its length in chapters. The constructor should therefore initialise a TextBook object by setting the title of the book to the specified String, and the length of the book to the specified int. In addition, the number of the last chapter read should initially be set to zero (as nothing has been read at this point)
Other Methods:
A TextBook object should also have the following public methods associated with it:
• a method getTitle() that returns the String that represents the title of the book.
• a void method readNextChapter() that 'reads' the next chapter of the book (if this is possible): i.e. it should cause the 'last chapter' field to be increased by one, but only if there are chapters left to be read! If there are no more chapters left to read (i.e. the last chapter read was the final chapter of the book) then it should simply print out a suitable warning message.
• a boolean method isFinished() that returns true if there are no chapters of the book left to read and false otherwise.
• a void method closeBook() that resets the last chapter read field to zero (i.e. it is used to return the book to its initial state, ready for the next person to begin reading it).
• a void method describe() that prints out a simple description of the text book, with the book title and number of chapters left to read, e.g.: "Programming with Java with 4 chapters left to read"
The LibraryCard Class
Fields (Instance Variables):
Your implementation of the LibraryCard class should provide the following private fields:

• an int field that holds the limit on the number of books that the card can be used to borrow.
• an int field that holds the number of books that have been borrowed on the card so far.
• a String field that holds a card reference, for e.g. "cardID 3", "cardID 27" or "cardID 94".
Constructor:
The constructor method should take two int parameters:
the first is used to set the limit on the number of books that can be borrowed with the card.
• the second is used to set the card reference. Note: the card reference should be a String of the form "cardID NUM", where NUM is the actual value of the second formal parameter of the constructor.
The constructor should also initialise the 'number of books borrowed' field as 0 when the card is constructed.
Methods:
There are four methods in addition to the constructor:
a method with signature public void swipe() which when invoked, increases the number of books borrowed on the card by one.
• a method with signature public boolean expired() which returns true if no more books can be borrowed on the card, and false otherwise.
• a method with signature public String getCardRef() that returns the value of the card reference field.
• a method with signature public void describe() that prints out a description of the card, for e.g. "Library card cardID 27 with 3 books left".
The Library Class
Fields (Instance Variables):
Your implementation of the Library class should declare the following private fields:
A field TextBook[] bookShelf which holds the library's collection of TextBook objects.
• You will also find it useful to have an int field (called nextBook or something similar) which indicates the position on the bookShelf where the next TextBook object can be found (the next one available for borrowing when someone presents a valid library card).
• an int field representing the number of borrowers who have been issued with library cards.
Constructor:
The class should have a constructor with a single integer parameter which determines the maximum number of TextBook objects that may be held on the library's bookShelf.
Note: A problem here is to set up the Library object up so that it contains TextBook objects in an array. There are several steps in Java to setting up an array of objects:
1. Declare a variable of the appropriate type (in this case it is just the field bookShelf).
2. Create an array and store it in the variable (at this point it is an array of nulls).
3. Fill the array up with suitable objects (for which you will need to use a suitable loop statement)
A further issue is how to construct the TextBook objects that are put into the bookShelf array. One simple possibility is to give all the books the same title and number of chapters. A better possibility would be to give the books different titles, for example "text book 1", "text book 2","text book 3" and so one (the number of chapters can still be the same for each book). This is fairly simple to do as you can keep track of the number of each book as you go through the loop statement.
Methods:
The class has the following methods in addition to the constructor:
a method with signature public LibraryCard issueCard() that when invoked issues (i.e. returns) a new LibraryCard object. The method should increment the count of the number of library borrowers by 1. Note: to issue a new LibraryCard it is necessary to provide two int parameter values (see description of LibraryCard constructor, above). The limit on borrowing can be fixed with a small int value, such as 5. However, the card identity number should be unique to each card, so you need to find a way of setting the actual parameter value to a different int value each time a new card is constructed. (Hint: think about numbering the cards sequentially, according to the number of borrowers. So, the first card issued might be given the reference "cardID 0", the next card "cardID 1", and so on.)
• A method with signature public TextBook borrowBook(LibraryCard card), which allows a book to be borrowed from the library if a valid (i.e. non-expired) LibraryCard is presented. If there are still books left to be borrowed in the library and the card object has not expired, then the method should return the next TextBook object from the bookShelf array (and otherwise, it should return the null object). The method should also 'remove' the TextBook object from the bookShelf (by setting the array location to null) and increment the field that indicates the location of the next book that may be borrowed. Finally, the method should ensure that the library card is 'swiped' to record that a book has been borrowed. (Note: you may also wish to ensure that your method behaves sensibly if passed a null LibraryCard object.)
• a method with signature public void returnBook(TextBook book) that allows a book to be handed back to the library. The method will need to put the book back in the bookShelf array. Note: it is important that it should do this in such a way that there are no 'gaps' on the shelf, and you may find that the pointer to the next book to be borrowed is again useful here. Once the TextBook has been put back in the array, the method will also need to change the 'next book' pointer appropriately.
• a method with signature public void describe() that, as usual, is responsible for printing out a description of the object. In this case, an example of the sort of message that should be printed out is: "The library has 15 books left on the shelf and has issued 7 library cards".
Testing
Having written the classes make sure that they work properly. Get one or more instances of the classes onto the BlueJ workbench and check that they behave the way that they should. For example, what happens if you try to borrow a book with an invalid card, or when there are no books left on the book shelf? Make sure that you can only borrow as many books from the library as were put on the book shelf in the first place, and that library card expires once it has been swiped up to its limit. Use BlueJ's inspect facility to check that text books borrowed from the library really are removed from the bookShelf array, and so on.
Layout and Code Style
It is important to make sure that you lay out your code properly. In particular make sure that everything is indented properly, and that opening and closing braces are lined up. Also make sure you use meaningful variable names and follow the Java naming conventions (i.e. follow capitalisation conventions). Note that no comments are required at this stage (we will be looking at commenting later).

Marking Scheme
50 marks awarded in all.
class TextBook: (12 marks overall)
Fields: 2 marks for correct work.
Constructor: 2 marks for correct work.
Methods: 8 marks in all for correct work. Methods getTitle() and closeBook() are worth 1 mark each. Method isFinished(), describe() and readChapter() carry 2 marks each. All marks lost for a method if it is completely incorrect, incoherent or missing. Lose 1 mark is isFinished() does the right thing but redundantly. Similarly, lose 1 mark for describe() if it uses more than a single print statement. For reachChapter(), the conditional expression should not allow a chapter to be read if the book is finished.
class LibraryCard: (worth 15 marks overall)
Fields: 2 marks for correct work.
Constructor: 3 marks for correct work.
Methods: 10 marks for work as per the spec. Methods describe() and getCardRef() are worth 2 marks each; methods swipe() and expired() are worth 3 marks each; Marks lost for use of incorrect return types, or over-use of conditional statements in method expired() etc.
class Library: (worth 23 marks overall)
Fields: 2 marks for correct work. Marks lost for missing out a field or failing to make it private or of the correct type.
Constructor: 4 marks for correct work. Marks lost for failing to initialise fields appropriately. Note that a loop is needed to initialise the bookShelf[] array. Marls lost for getting the bounds on the loop wrong or failing to build a new TextBook object to assign to each location. One mark lost for failing to give each book a unique title (same number of chapters is fine).
Methods: 17 marks for correct work. Methods returnBook() and describe() earn 3 marks each; method issueCard() is worth 4 marks, and method borrowBook(LibraryCard card) is worth 7. Marks lost for a method if it is completely incorrect or missing. Marks also lost for failing to implement a method as described in the brief (e.g check that borrowers field is incremented when a card is issued, and that the LibraryCard gets a unique card reference number. Marks lost if the the returnBook(TextBook book) method doesn't put books back in the way specified in the brief.
Layout & Commenting:
Code should be laid out clearly and systematically. Indentation should be used, and a consistent and sensible bracketing convention adopted throughout. Marks are lost for weird, unsystematic, inconsistent or obscure layout. Comments are not expected.

caozhy
贵阳老马马善福专门编写代码的老马就是我! 感觉是个二代,出国留学还不好好学,平民子弟谁舍得这么糟塌学费。
11 个月之前 回复

2个回答

TextBook class

 class TextBook {
    String title;
    int length;
    int last;

    public TextBook(String str,int len) {
        title=str;
        length=len;
        last=0;
    }

    public String getTitle(){
        return title;
    }

    public void readNextChapter(){
        if(last>length){
            System.out.println("ERROR : There is no next chapter");
            return;
        }
        last++;
    }

    public boolean isFinished(){
        if(last==length)
            return true;
        return false;
    }

    public void closeBook(){
        last=0;
    }

    public void describe(){
        System.out.println(title+" with "+(length-last)+"chapters"+" left to read ");
    }

}

class LibraryCard{
    int limit;
    int number;
    String id;

    public LibraryCard(int l,int num){
        limit=l;
        id="cardID "+String.valueOf(num);
        number = 0;
    }

    public void swipe(){
        number++;
    }

    public boolean expired(){
        if(number>limit)
            return false;
        return true;
    }

    public String getCardRed(){
        return id;
    }

    public void descripiton(){
        System.out.println("Library card "+getCardRed()+" with "+number+" books left ");
    }


}

class Library{
    TextBook[] bookShelf;
    int nextBook;
    int borrowers;

    public Library(int max){
        bookShelf= new TextBook[max];
    }

    public LibraryCard issueCard(){ 
        return new LibraryCard(5,borrowers++);
    }

    public TextBook borrowBook(LibraryCard card){
        if(card.expired()&&(bookShelf.length>=nextBook&&card!=null)){
            bookShelf[nextBook]=null;
            card.swipe();
            return bookShelf[nextBook++];
        }
        else
            return null;
    }

    public void returnBook(TextBook book){
        bookShelf[--nextBook]=book;
    }

    public void describe(){
        System.out.println("The library has "+(bookShelf.length-nextBook)+" books left on the shelf and has issued "+borrowers+" library cards ");
    }

}

直接翻译过来就已经很明了 了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求大神解题,本人初学者
大数学家欧拉在集市上遇到了本村的两个农妇,每人跨着个空篮子。她们和欧拉打招呼说两人刚刚卖完了所有的鸡蛋。 欧拉随便问:“卖了多少鸡蛋呢?” 不料一个说:“我们两人自己卖自己的,一共卖了150个鸡蛋,虽然我们卖的鸡蛋有多有少,但刚好得了同样的钱数。你猜猜看!” 欧拉猜不出。 另一个补充道:“如果我按她那样的价格卖,可以得到32元;如果她按我的价格卖,可以得到24.5元”。rn 写出每人鸡蛋的数目 ? rn [size=18px]要用c#做,求代码[/size]
初学者如何学习网页设计!!求大神指导
学习css和的div,但收获不是很大,逻辑上还是很混乱,没有头绪!!有木有学习网页设计的方法!求指导!!
求大神解读代码
查询1:rn[code=sql]rnselect jk.jk_xh,rnjk.rk_rq,rn(select kk.dzsph_xhrn from t_zs_skykkxx kk rn where kk.jk_xh = jk.jk_xh rn and kk.zf_bj = '0') as dzsph_xh ,rnjk.pz_xh rnfrom t_zs_jkmx jk rnwhere jk.zf_bj = '0';rn[/code]rn查询2:rn[code=sql]rnselect jk.jk_xh,rnjk.rk_rq,rn kk.dzsph_xh,rnjk.pz_xh rnfrom t_zs_jkmx jk ,t_zs_skykkxx kk rnwhere jk.zf_bj = '0'rnand kk.jk_xh = jk.jk_xhrnand kk.zf_bj = '0';rn[/code]rn这两个查询哪个效率比较高,为什么?顺便问下查询1的执行顺序,是先执行rn[code=sql]rnselect kk.dzsph_xhrn from t_zs_skykkxx kk rn where kk.jk_xh = jk.jk_xh rn and kk.zf_bj = '0'[/code]rn这段代码嘛?rn顺便问一下,oracle查询语句执行顺序,如何优化查询语句,提高查询效率。
我是如何学习计算机编程的
我是如何学习计算机编程的。 我在很小年纪的时候就开始学习编程,我学习编程的方法是创建大量的不同的网站。下面列出的是我创建的主要的网站,其中最早的一个是我11岁时开发的。我希望读者能从我这些复述中获得的信息是:如果你想学习编程,做大量的练习性的项目是非常必要的。
应该如何学习计算机编程.docx
应该如何学习计算机编程,不要只是去学各种语言、工具
小白如何开始学习计算机编程?
编程很有趣,非常有用。它可以发挥创意,并开辟广泛的新职业。如果想学习如何编程,请阅读下面的文章,了解去哪里和学习什么。 选择一种编程语言。计算机编程基本上是一组计算机遵循的书面指令(也称为二进制编码)。这些指令可以用许多不同的“语言”编写,或者只是组织指令和文本的不同方式。但是,不同的语言往往会用于创建不同类型的程序,因此选择想要做的相关的语言。如果认为某种语言不符合自己的需求,可以随时使用新语言...
求大神解读小弟的疑惑
在qt中 bool是什么意思,又是怎么运用的呢,在最新的qt版本中。bool可不可以被省略?
求大神解读一下程序
double l = GetFastFading ()->at (i).at (index) - GetPathLoss () - GetPenetrationLoss () - GetShadowing ();rn loss.push_back (l);
初学者求大神指导
小弟初学Java遇到一个难题,求大神指导。rnrn题目:从键盘输入三个数,并赋值,比较之后按从小到大的顺序输出。
初学者,求大神解答
为什么这两代码在控制台那里运行不出来,显示的是我之前打的同一包中不同类的运行结果,求解答,,rn[img=https://img-bbs.csdn.net/upload/201907/30/1564453771_99934.png][/img][img=https://img-bbs.csdn.net/upload/201907/30/1564453776_146129.png][/img]
java初学者 求大神
代码rn<%@ page language="java" import="java.sql.*"rn contentType="text/html; charset=gb2312" pageEncoding="gb2312"%>rn<%@page import="java.lang.*"%>rnrnrnrn rn Insert title herernrnrnrn <%rn java.sql.Connection conn;rn java.lang.String strConn;rn java.sql.PreparedStatement preparedStmt = null;rn //语句对象rn java.sql.ResultSet sqlRst = null; //结果集对象rn try rn Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();rn conn = java.sql.DriverManager.getConnection(rn "jdbc:oracle:thin:@10.128.9.239:1522:ADP630",rn "javastudy", "javastudy");rn //设置参数rn String parm = request.getParameter("parm"); rn String parm1=new String(request.getParameter("parm1").getBytes("iso-8859-1")); rn String parm2=new String(request.getParameter("parm2").getBytes("iso-8859-1"));rn rn if (parm != null) rn preparedStmt = connrn .prepareStatement("select * from EMP t where EMPCODE like ?");rn preparedStmt.setString(1, "%" + parm + "%");rn sqlRst = preparedStmt.executeQuery();rn else if ((parm == null) && (parm1 != null)) rn preparedStmt = connrn .prepareStatement("select * from EMP t where EMPNAME like ?");rn preparedStmt.setString(1,"%" + parm1 + "%");rn sqlRst = preparedStmt.executeQuery();rn else if ((parm == null) && (parm1 == null) && (parm2 != null)) rn preparedStmt = connrn .prepareStatement("select * from EMP t where SEX like ?");rn preparedStmt.setString(1, "%" + parm2 + "%");rn sqlRst = preparedStmt.executeQuery();rn elsern out.println("请输入:");rn //执行SQL 语句rn %>rn 顾客信息表rn rn rnrn 编码rn 姓名rn 性别rn 生日rn 邮编rn 地址rn 电话rn 工资rn rn <%rn while (sqlRst.next()) //取得下一条记录rn %>rn rn rn <%=sqlRst.getString("empcode")%>rn <%=new String(sqlRst.getString("EMPNAME").getBytes(rn "gb2312"))%>rn <%=new String(sqlRst.getString("SEX").getBytes(rn "gb2312"))%>rn <%=new String(sqlRst.getString("BIRTHDAY").getBytes(rn "iso-8859-1"))%>rn <%=new String(sqlRst.getString("POSTCODE").getBytes(rn "gb2312"))%>rn <%=new String(sqlRst.getString("ADDRESS").getBytes(rn "gb2312"))%>rn <%=new String(sqlRst.getString("PHONE").getBytes(rn "iso-8859-1"))%>rn <%=new String(sqlRst.getString("WAGE").getBytes(rn "iso-8859-1"))%>rnrn rn <%rn //out.println(parm1);rn %>rn rn <%rn //关闭结果集对象rn sqlRst.close();rn //关闭语句对象rn preparedStmt.close();rn //关闭数据库连接rn conn.close();rn catch (java.sql.SQLException e) rn out.println(e.toString());rn rn %>rnrnrnrnrnrnrn在连接数据库之后,执行查询时为什么只有输入parm时可以成功,在输入parm1和parm2查询时均不成功呢??? 求大神指教啊!!
初学者求大神解答
protected void Button1_Click(object sender, EventArgs e)rn rn string name = Session["Vipname"].ToString();rn string userid = Session["Vipcard"].ToString();rn string zhuti = txt_zhutiadd.Text.ToString();rn string neirong = txt_neirongadd.Text.ToString();rn //string time = DateTime.Now.ToString();rn string sConn = ConfigurationManager.ConnectionStrings["ConnStr"].ToString();rn using (SqlConnection Conn = new SqlConnection(sConn))rn rn Conn.Open();rn using (SqlCommand cmd = new SqlCommand("Insert INTO [Liuyan] ([lytitle], [lycontent] ,[username] , [userid]) VALUES (@zhuti,@neirong,@name,@userid)", Conn))rn rn cmd.Parameters.AddWithValue("@zhuti", zhuti);rn cmd.Parameters.AddWithValue("@neirong", neirong);rn //cmd.Parameters.AddWithValue("@time", time);rn cmd.Parameters.AddWithValue("@name", name);rn cmd.Parameters.AddWithValue("@userid", userid);rn cmd.ExecuteNonQuery();rn rn rn rn rn总是报错,看了半天实在是看不出哪里错了,求大神解答rnrn编译不报错 运行出错rnrn行 40: cmd.Parameters.AddWithValue("@name", name);rn行 41: cmd.Parameters.AddWithValue("@userid", userid);rn行 42: cmd.ExecuteNonQuery();rn行 43: rn行 44: rn rnrn
给初学者学习NS2入门指导
序 很多人都问我新手应该看些什么资料,或者怎么熟悉 NS2 这个工具。这是让 很多入门者非常头痛的问题,包括我自己,当初也是困难重重,不过现在让我说 我也没什么印象了,因为我当时比较盲目看了很多兑现在一点儿用都没有的资 料。为了能让写的东西真的对新手有所帮助,刚才跟我师弟 crabhit 谈了谈,所 以总结了一下,希望能起到抛砖引玉的作用。
大数据学习入门难,给初学者支招
大数据具体是怎样的存在,不同的人,不同的立场有不同的看法。也可以抽象为大数据不仅仅是一种概念那么简单,更是一种方法。最终的目的就是通过分析和挖掘全量的非抽样的数据辅助服务决策。 很对人对于大数据没有清晰的认识,大数据一方面是基于海量的数据,另一方面最为重要的最有就是能我们是生活变得更加方便,能够依据个人喜好偏好,推荐为你有用的信息,减少我们搜寻浪费的时间,也能提高工作效率,筛出无用数据。随着...
计算机编程入门图文教程
图文结合的编程入门书,简单易懂,入门必备基础书。不过是英文的,需要一点点阅读能力
本人新手,老师布置的作业不会写,求大神带
我们讲Java是全英教学讲得还超级快,小弟我就上了了两次课老师布置个作业把我难住了,昨晚忙到两点半还是不会,求大神指点啊!!SOS!rn主要想请教Java里是如何创建对象的。rn题目翻译成中文如下:rn编写一个程序,定义一个表示员工的类Staff,类的属性包括编号(num)、姓名(name)、出勤率(rateOfAttend)、基本工资(basicSal)、奖金(prize),员工实发工资(wage)其中员工实发工资=基本工资*出勤率+奖金。定义一个类StaffTest,创建Staff类的对象,通过键盘输入员工基本信息,计算员工实发工资,并输出对象所有属性信息。 
winform 求大神 本人感激不尽
怎么在winform窗体导入一个地图,并且能计算地图两点间的距离
计算机编程入门(3):变量
貌似有很多人不满意呢…… 我写的不好请原谅,也请各位多多鼓励哈!   第二章 变量与运算   2.1 变量 变量这个名字大家可能一点都不陌生,就比如说数学中的a,b,c就都是变量,可是当这个词被用于程序中时,就带上了一点点不同。   再讲这个不同之前,我想先举一个例子。 估计大家都知道最大公约数,也知道欧拉的辗转相除法,具体一点的算法如下所示:   输入n,m 0.如果...
求大神帮忙 本人新手
现有一条数据是这样的rnID userid type lr_frm Postdate lr_to Enddate lr_hrsrn1 3433 事假 2016-05-25 00:00:00.000 07:00 2016-05-26 00:00:00.000 19:00 12.00rnrn这条数据是用表变量查询出来的 实体表里的数据没有07:00 和19:00 这两个字段 现要做个报表,客户要求要有这两个字段 并且开始时间永远是从07:00开始 结束时间根据请假时长加上开始时间得来的。 rn 现在就是如果碰到 跨天的情况 比如上面的 请假日期是25号到26号 ,那么就要把这条数据根据实际相差天数来拆分显示,一条显示25号的请假,一条显示26号的请假 并且请假时长也需要拆分 一天上班时间总共是8小时,所以拆分出来的数据第一条请假时长肯定是8小时,第二条的请假时长根据你总共请假时长去减。所以要得到以下的样子rnrnID userid type lr_frm Postdate lr_to Enddate lr_hrsrn1 3433 事假 2016-05-25 00:00:00.000 07:00 2016-05-25 00:00:00.000 15:00 8.00rn1 3433 事假 2016-05-26 00:00:00.000 07:00 2016-05-26 00:00:00.000 11:00 4.00rnrn字段说明 rn lr_frm 请假开始日期rn lr_to 请假结束日期rn Postdate 请假开始时间rn Enddate 请假结束时间rn lr_hrs 请假时长rnrnrn求大神指教,本人新手。急
本人新手,求大神指点
软件工程的,大学刚开始,自学C语言中,想问下,电脑哪个编译器好点?
求大神、本人数据库菜鸟
两个date类型的日期可以做减法么?to_date(substr(sysdate,1,10)) 和 to_date(rq,'yyyy-mm-dd'),rq字段是varchar2(8)数据类型,在oracle中。rn 问题的背景是,rq是一个开始日期,然后我要算出这个人的从开始日期到现在为止的从业年限。
一道C语言编程题,本人初学者,求大神解答
编写程序实现功能:数据文件story.txt是一篇英文小故事,请先统计其中26个字母的出现次数。n要求一:再根据用户要求,输出某个字母的出现次数,直到用户输入#为止。n要求二:请输出出现频率最高的三个字母和它们的出现次数。n
Python和计算机编程入门
Python和计算机编程入门
求大神给个html5,,,css3的学习教程,,求学习,,
求大神给个html5,,,css3的学习教程,,求学习,,rn我是真心想学习html5和css3的希望大神们给个教程学习学习,,谢谢啦,,,,
vc++课件(计算机编程入门)
vc++课件,入门级,如果学过c的话掌握语法大约要一个月(一般人,据说大神只用3天),想熟练掌握的话请同志们多敲代码吧
学习计算机编程的真谛
学习计算机编程的真谛, 要多动手编写代码,多用脑思考. 通过了解计算机软件的历史变迁,对比前后设计的变化,从中学到知识. 从C语言的联合体,到Java的类; 从数据结构的时间复杂度,空间复杂度, 到现在的编码复杂度; 从Hibernate, Mybatis到Bee 从EJB到spring 讲究的是从复杂到简单,追求轻量级. 编码复杂度则更加彻底的研究问题规模与编码量的关系。 ...
求大神给看看
发不了邮件,求大神看看哪儿有问题rn rn protected void btbConfirm_Click(object sender, EventArgs e)rn rn string str1 = "select * from yhxxb where dzyx='" + txtEmail.Text + "' and yhm='" + txtUsername.Text + "'";rn if (DataBase.ExecuteRead(str1))rn rn SendMessage();rn rn elsern rn DataBase.AlertMessagge(Page,"",GetType(),"用户名或邮箱错误!");rn rn rn public void SendMessage()rn rn string sqlcon = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["myConnection"].ConnectionString;rn string str1 = "select * from yhxxb where dzyx='" +txtEmail.Text + "' and yhm='" + txtUsername.Text + "'";rn SqlConnection con = new SqlConnection(sqlcon);rn con.Open();rn SqlCommand cmd = new SqlCommand(str1, con);rn SqlDataReader dr = cmd.ExecuteReader();rn if (dr.Read())rn rn //取数据库中的用户名和密码rn string password = dr["mm"].ToString();rn string username = dr["yhm"].ToString();rn MailMessage mail = new MailMessage("982112101@qq.com","'" + txtEmail.Text.Trim() + "'");rn mail.Subject = "找回密码";rn mail.Body = "用户您好 您的用户名为:'" + username + "' 您的密码为:'" + password + "' 请妥善保管!";rn mail.IsBodyHtml = true; // 是否是HTML格式rn SmtpClient smtp = new SmtpClient();rn smtp.Host = "smtp.qq.com";//QQ的SMPT服务器IPrn smtp.Port = 25;//SMPT端口号,一般为25rn smtp.Credentials = new System.Net.NetworkCredential("982112101@qq.com","321"); //指定登录服务器(即邮箱的帐号和密码)的用户名和密码,注意要在自己邮箱中设置开启SMTP服务rn tryrn rn smtp.Send(mail);rn rn catch (SmtpException ex)rn rn Response.Write(ex.Message);rnrn rn dr.Close();rn con.Close();rn rn rnrn参数或变量中有语法错误。 服务器响应为: Bad address syntaxrn
求大神给帮帮忙
“SELECT a."FLIGHT_DATE", rn a."FLIGHT_NO", rn a."AC_REG", rn a."AC_TYPE",rn a.ARRIVAL_AIRPORT,rn a.STD,rn a.ETD,rn a.DEPARTURE_AIRPORT, rn a."FLIGHT_ID",rn a."CREW_LINK_LINE",rn (select count(1) from t9001 where t9001.flight_id = a."FLIGHT_ID") is_send,rn '' route,rn '' route_name,rn 0 p_count,rn b.crew_s_num,rn b.crew_a_weightrn FROM "T2001" a, "T4007" brn WHERE a.ac_type=b.ac_type_short andrn rn (a.flg_cs is null) and rn (nvl(trunc(a.etd),trunc(a.flight_date)) = to_date(:as_date,'yyyy-mm-dd' ))rn”这个程序我已经改过可是在程序运行时还是会出现指定的route 列在某种条件下显示不出来 求大神给答案。。。
计算机编程英语词典 方便学习
计算机编程英语词典 关于编程的单词都有 方便学习
关于计算机编程的学习?
我是一个大三的计算机专业的学生~~~~我丛心里喜欢计算机,三年以来,也学到了不少东西~但也有不少迷茫~~````我喜欢程序设计`和网络技术,我知道学好两重是不实际的~``我自认为我如过专攻网络``我明年过网络设计师的可能性很大的~`但我也放不下编程~````时不时就在搞网络技术学习是想学编程`~``在编程的道落上~```我也有近两年的时间```虽然没有什么成果````但对对目前各种语言的套路我还比较熟悉~(象c/c++,deplhi,vb,asp,vbscript,java`~`vfp比较熟悉)~` rn> 我现在很迷茫~`````希望你能给予指点~``教一个好的化结方法 rn
图像识别作业, 求大神思路
[img=https://img-bbs.csdn.net/upload/201711/03/1509687727_159447.png][/img]rnrn环境:字体 与 背景色 相同, 字符(长度随机字符随机)投影角度随机rn作业 在随机投影角度情况下,准确识别出如图 中的 字母 数字 rn求大神 给点思路
初学者学习CAN总线入门
如果你完全没学过CAN总线,那你看什么都迷茫,看了这个,可以让你在一天的时间内明白CAN协议。当然具体操作还要看你的片子等。
学习计算机编程英语词汇
挺全的,供学习编程的同仁一起交流,一起学习,一起进步!!!
想学习计算机编程
rn 学习那门编程语言比较容易上手!rnrn 小弟零零散散学习了C C++ Java C# 等语言都是出于学习基础语言阶段,不能够深入学习,就是那种 浅尝辄止的那种!rnrn 现在突发学习计算机编程语言的念想,想把自己以前学习的编程语言给系统化,体系化!哪怕学精细一门语言也行,现在觉得编程很不错,很对自己具有吸引力!rnrn 现在鉴于自己对计算机知识的“孤陋寡闻”和“一瓶子不满半瓶子咣当”的状态!rnrn 我应该如何下手去学习计算机编程呢?rnrn 是编程高手的回帖!rnrn [b] 求导师~~~~[/b][size=18px][/size]
学习计算机编程的疑惑
各位大神好,我现在是一名大三学习计算机软件那块的学生,由于学校原因,现在才接触专业课程,比如数据结构,每次写代码,老错,完全看不懂出错提示,真的很打击自信,我同学基本打算放弃(以后工作基本用不上,因为现在大部分时间必须花在其他无聊的事上),但是我心里不甘啊,我不愿意什么都没学到,虽然以前成绩一般,但好歹比重本高了几十分,但是现在就这样,感觉我的人生从此太没意思了。真的想学点有用的看看将来有没机会跳出现在这个圈子,不想工作在这个圈子里,自己去找工作。所以想问下大神你们以前如果说学习初期困难是怎么度过的,并希望推荐几本书籍和一些建议,小弟在此谢过了!
紧急求援!本人在国外(关于Cobra and Java)
各位朋友大家好,本人现在University of Pretoria攻读Computer Science研究生,从研一读起,说来惭愧,本人在国内97年计算机专业毕业,有MCP/MCSE/MCDBA,并擅长VC及数据库的开发,工作六年后到这里攻读硕士,原以为比较轻松,哪知一上来就被打了闷棍,学的东西我基本不太懂,而且非常紧张,开学才一个月,就不停地有Project,Assignment,以及定期的test,马上就是semester的考试了,我却学得非常吃力,其中最不懂的一门是Distributed System(分布系统),用的是Cobra,IDL和JAVA,这些我从未接触过,老师不停地要求编程,我简直一窍不通,非常非常着急.rn首先,希望哪位朋友能给我指点一下,怎样才能在短期内学好这门课,该看哪些资料,在哪里找?最好是中文的.rn第二,我手上有一个Assignment,3月10日就要交,是用IDL实现一个客户机和服务器,用C++编很简单,但用这些我就不会,能不能帮忙给弄一下,实现之后我得具体地感谢你.rn我的联系方式是:xddid@hotmail.com,QQ:175150,由于时差问题,如果你上网的话,请发消息到我手机(免费),发消息的网站是www.vodacom.co.za/sms/internet_sms.asp,进去后,在手机号码栏填:0822957878,在下面的消息框输入信息,不支持中文,请用英语或拼音.rn非常非常非常地感谢!!!!!!!!!!!!!!rnPeter.Xie
计算机编程 学习 Linux教程
计算机编程学习 Linux教程 计算机编程学习 Linux教程
学习计算机编程的培训资料
在学校学习编程的资料和大量的ACM题目,作为平时的学练很不错哦
初学者提问 求大神解惑
假设整型变量x的当前值为2,则复合赋值语句x/=x+1执行后x值为多少?rnrn我编了程序rnpublic class Testrnrn public static void main(String[] args)rn int x=2;rn x/=x+1;rn System.out.println("x="+x);rnrn结果为0rn请问是怎么运算出来的
protel初学者,求大神指点。
画好一个图之后,要编辑看看图有没有啥问题,但是出现了如下的情况: 管理项目里面第二行,没有 “compile pcb project ”这个可选择的编译的指令,求指点。
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池