# 學號 2017-2018-20172309 《程序設計與數據結構》實驗1報告

學號 2017-2018-20172309 《程序設計與數據結構》實驗1報告

課程:《程序設計與數據結構》
班級: 1723
姓名: 王志偉
學號:20172309
實驗教師:王志強老師
實驗日期:2018年3月21日
必修/選修: 必修html

1.實驗內容java

  • 學會使用JDK編輯、編譯、運行並檢查簡單的Java程序。
  • 學會使用intellj IDEA 編寫程序。
  • 學會在intellj IDEA 中的設置斷點以及單步運行IDEA使用教程

2.實驗過程及結果git

  • 首先使用虛擬機中的JDK把實驗PP2.五、PP3.三、PP3.五、PP3.8例題作了。
  • 而後通過九九八十一難把intellj IDEA 安裝上了。
  • 安裝好了intellj IDEA卻不會用,而後請教了別人很久,加上教程把它們大概弄明白了。

3.實驗過程當中遇到的問題和解決過程數據結構

問題1:在使用虛擬機Jdk作例題PP3.3出現了麻煩,發現超綱!
問題1解決方案:dom

  1. 上課時老師講了一種讓咱們可以理解的方案:ide

    import java.util.Random;
    public class homework3_3
    {
    public static void main(String []args)
    {
    Random generator = new Random();
    int a1,a2,a3,b,c,d1,d2,d3,d4,d5,e;
    a1 = generator.nextInt(8);
    a2 = generator.nextInt(8);
    a3 = generator.nextInt(8);
    b = generator.nextInt(556)+100;
    d1 = generator.nextInt(10);
    d2 = generator.nextInt(10);
    d3 = generator.nextInt(10);
    d4 = generator.nextInt(10);
    System.out.print(+a1);
    System.out.print(+a2);
    System.out.print(+a3);
    System.out.print("-"+b);
    System.out.print("-"+d1);
    System.out.print(+d2);
    System.out.print(+d3);
    System.out.print(+d4);
    System.out.println("");
    }
    }idea


這是分割線
***************************************************************************************設計

  1. 以後學長又教了咱們一種方法:版本控制

    public class telephonenumber {
    public static void main(String[] args) {
    DecimalFormat decimalFormat = new DecimalFormat("000");
    DecimalFormat decimalFormat1 = new DecimalFormat("0000");
    Random random = new Random();
    int num = random.nextInt(8);
    int num1 = random.nextInt(8);
    int num2 = random.nextInt(8);
    int num3 = random.nextInt(656);
    int num4 = random.nextInt(10000);
    System.out.println("電話號碼:" + num + num1 + num2 + "-" + decimalFormat.format(num3) + "-" + decimalFormat1.format(num4));
    }
    }orm

問題2:安裝intellj IDEA 也出現了麻煩,由於網速緣由,直接從別人電腦把整個IDEA文件拷貝到本身電腦,致使git時文件路徑不同。
問題2解決方案:
1.直接拷貝文件程序,會出現以上狀況。能夠修改文件路徑:設置》版本控制》GIt
2.能夠直接把別人的安裝包拷貝過來,以後自動匹配!!!

其餘(感悟、思考等)

  • 此次實驗課讓我複習了javac 、javac -cp 、java 、 java -cp的聯繫與區別。
  • 除此以外,發現IDEA賊好用,之前用虛擬機打的代碼如今用IDEA只需一半的時間。

參考資料

Markdown的經常使用語法說明

IDEA使用教程

IDEA註冊碼申請 ...

相關文章
相關標籤/搜索