CSC2 520  200 8  Spring Data Structures  and Applications Assignment 1 FAQ Last updated:  4   Feb , 200 8
<ul><li>I collected some of the students’ questions together here.  </li></ul><ul><li>You may encounter the same problems ...
Q1 <ul><li>Q: when I try to follow the tutorial note to input the file, the Eclipse point out that can't found the file. <...
Q2 <ul><li>Q: I have define the class customer. when i want to use the method Customer(int T,int N, Float[] P) in supermar...
Q3 (Error about Object Array)   <ul><li>Q: I want to ask what is the java.lang.NullPointerException? And how can I solve t...
Q4 <ul><li>請問我用不用在每一個會有機會有 exception 的地方加上 throw HeyException 呢 ? </li></ul><ul><li>答:我建議你可以這樣做,因爲這樣有助于你形成良好的編程習慣。在我們的作用中,...
Q5 <ul><li>我需不需要把 comment 寫在 source code 內 ,  還是在 header 簡述即可 ? </li></ul><ul><li>答: Comment 寫在 Code 内,在 Header 内是對整個 Clas...
Q6 <ul><li>請問你有沒有一個 supermarket.dat 可測試 question2  的所有 function, 我已嘗試使用你所提供的 supermarket.dat 以及根據你的 tutorial note 用的 case ...
Q7 <ul><li>assignment 的 deadline 是中午 12 時嗎 ?  如是 ,  可以押後至晚上 11:55pm 嗎 ? </li></ul><ul><li>答: Deadline 是晚上 12 點 </li></ul>
Q8 About Scanner <ul><li>Please follow the tutorial 02 about how to use the scanner </li></ul>
Upcoming SlideShare
Loading in …5
×

香港六合彩

781 views

Published on

老班能拿你怎样?吓吓你的。王峰一脸不在乎。我才不怕,顶多香港六合彩不让我上课,顶多让我把爸妈全喊来。不会不会,车到山前必有路,没事的。事已至此,王峰只能这样安慰。香港六合彩自己也犯难过,知道其中滋味,那次正巧碰上香港六合彩父母吵架,香港六合彩可不想香港六合彩气头上的火烧到自己身上,没说,后来也没事。子允叹了口气,没说话。一整天,子允都很老实,每逢班主任课间视察班级,都不敢抬头,恨不能长得小点钻到课桌肚里。到了马老师的课,子允如坐针毡,一堂课下来连腿上的痒痒都不敢挠一下,和王峰去食堂的路上直喊得了颈椎病。一天下来倒也无事,子允渐渐觉得王峰的话有道理,老师能怎样?如此想来,倒有些得意,还有种战胜的快感。心情稍转,香港六合彩多瞟了周晨晨几眼,两人目光碰上两次,都是子允先闪开。回味香港六合彩的眼神,有关切,也有羞怯,但一直没来找。放学了,王峰要训练,非要子允陪同。躲过一劫的子允虽然还担心明天,毕竟松弛不少,散散心蛮好。看王峰训练可不是苦差,王峰是队长,等教练把硬性规定的准备活动做完,再布置一下大体训练方针,剩下的就会全权交给王峰,所以子允常能混到上场踢球的机会。今天教练要求香港六合彩分两小组对抗,等于给子允一个金牌入场券。球队人少,分成两组更少,有非球队的人参加,教练一般不干涉。球员都与子允熟了,自然很欢迎。校队的整体技术不错,在区里获过金牌。对于见识过市队的子允来说,这些人不那么可怕,单从技术而言,甚至觉得有那么几个队员还不如自己厉害。跟香港六合彩踢球,子允没任何心理压力,很放松,几脚大力抽射后就把一整天的压抑排遣出来,顿觉神清气爽。正在爽头,高大的教练在场边招呼子允过去。子允见教练满脸笑意,估计是刚才踢得太出色要招自己进球队,立马心里告诫自己要冷静,虽然很喜爱足球,但凭学习能力和现在的课程,几天球踢下来估计就会在班级里的后几名转悠了,如果想靠足球找出路,现在也太晚,没听说过哪个球星是从高中开始正式接触足球的。《Y滋味》婉言拒绝子允向香港六合彩走去,考虑如何婉言拒绝,以便不把关系弄僵,以后也好来蹭球踢。来到结实高大的教练面前,子允竖起的耳朵听到的却是班主任的声音,赵子允,这是你来的地方吗?子允以为幻觉,一眨眼,见香港六合彩从教练身后站出来。子允像在八宝饭里吃到绿头苍蝇,苦着脸结巴道,我……呃……在锻炼身体,学习一天了想……想活动活动。活动活动?我看你球踢得不错,想朝这方面发展发展?说完笑着看教练,教练忙讨好地点头。子允愣住了,怎么,香港六合彩不是来追究请家长的?琢磨琢磨,不像说反话,难道香港六合彩忘记了?香港六合彩不敢应承,担心话中有诈。王峰看到马老师嘴皮翻飞,又看见子允低垂着头

Published in: Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
781
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

香港六合彩

  1. 1. CSC2 520 200 8 Spring Data Structures and Applications Assignment 1 FAQ Last updated: 4 Feb , 200 8
  2. 2. <ul><li>I collected some of the students’ questions together here. </li></ul><ul><li>You may encounter the same problems as other students. </li></ul><ul><li>Hope this can help your guys to do the assignment 1. </li></ul>
  3. 3. Q1 <ul><li>Q: when I try to follow the tutorial note to input the file, the Eclipse point out that can't found the file. </li></ul><ul><ul><li>My code:   </li></ul></ul><ul><ul><li>Scanner scanner = new Scanner(new File(&quot;d:/supermarket.dat&quot;)); </li></ul></ul><ul><ul><li>and i have already out the file in that path. </li></ul></ul><ul><li>A: In this case, the path should be &quot;d:upermarket.dat&quot;. In the string, use “ to represent character “” </li></ul>
  4. 4. Q2 <ul><li>Q: I have define the class customer. when i want to use the method Customer(int T,int N, Float[] P) in supermarket class. The complier tell me that the constructor Customer is undefine. even if I use the Customer(int T,int N, Float[] P) as method, the complier still say that it is undefine. </li></ul><ul><li>here is my code: </li></ul><ul><li>  </li></ul><ul><li>for the constructor: </li></ul><ul><li>public Customer(int T, int N, float[] P) {   timeOfArrival=T;   numberOfItems=N;   System.arraycopy(P,0,itemPrices,0,P.length);  } </li></ul><ul><li>  </li></ul><ul><li>for the main class: </li></ul><ul><li>  </li></ul><ul><li>int arriveTime = n; </li></ul><ul><li>int ItemNum = value[n].length(); </li></ul><ul><li>Float[] price = new Float[k+1]; </li></ul><ul><li>Customer custom = new Customer(arriveTime, ItemNum, price); </li></ul><ul><li>  </li></ul><ul><li>then the compiler said that the last command is error. </li></ul><ul><li>A: From your description, it seems the compiler can not find the class. </li></ul><ul><li>I suggest you to check the following two thins: </li></ul><ul><li>1. Is the class Customer defined in a individual file Customer.java? </li></ul><ul><li>2. Does the file Customer.java put in the same folder with Supermarket.java? </li></ul>
  5. 5. Q3 (Error about Object Array) <ul><li>Q: I want to ask what is the java.lang.NullPointerException? And how can I solve the problem? </li></ul><ul><li>A: The Java runtime throws java.lang.NullPointerException when an application attempts to use a null value as if it were an object. I guess it caused by using the array. </li></ul><ul><li>Two possible explanations: </li></ul><ul><li>1. You've indexed past the array bounds 2. You haven't initialized the array correctly </li></ul><ul><li>// example of an incorrectly initialized array: </li></ul><ul><li>public class Test { </li></ul><ul><li>public static void main(String args[]) { </li></ul><ul><li>String sa[] = new String[5]; </li></ul><ul><li>sa[0].charAt(0); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>// example of a correctly initialized array: </li></ul><ul><li>public class Test { </li></ul><ul><li>public static void main(String args[]) { </li></ul><ul><li>String sa[] = new String[5]; </li></ul><ul><li>for(int i = 0; i < 5; i++) { </li></ul><ul><li>sa[i] = new String(); </li></ul><ul><li>} </li></ul><ul><li>sa[0].charAt(0); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  6. 6. Q4 <ul><li>請問我用不用在每一個會有機會有 exception 的地方加上 throw HeyException 呢 ? </li></ul><ul><li>答:我建議你可以這樣做,因爲這樣有助于你形成良好的編程習慣。在我們的作用中,良好的編程風格會有部分的分數。 </li></ul>
  7. 7. Q5 <ul><li>我需不需要把 comment 寫在 source code 內 , 還是在 header 簡述即可 ? </li></ul><ul><li>答: Comment 寫在 Code 内,在 Header 内是對整個 Class 的一個簡單描述 </li></ul>
  8. 8. Q6 <ul><li>請問你有沒有一個 supermarket.dat 可測試 question2 的所有 function, 我已嘗試使用你所提供的 supermarket.dat 以及根據你的 tutorial note 用的 case 製做的 supermarket.dat 來測試 , 均能正常運作 , 這是否已經沒問題嗎 ? </li></ul><ul><li>答:對不起,現在沒有, Test Case 會在檢查作業的時候才去設計。你可以自行設計一些數據,然後自己根據過程去計算結果,看看與程序結果是否一致來驗證。 </li></ul>
  9. 9. Q7 <ul><li>assignment 的 deadline 是中午 12 時嗎 ? 如是 , 可以押後至晚上 11:55pm 嗎 ? </li></ul><ul><li>答: Deadline 是晚上 12 點 </li></ul>
  10. 10. Q8 About Scanner <ul><li>Please follow the tutorial 02 about how to use the scanner </li></ul>

×