# Weekly Meeting 3/16 --- ## Outline - 分類進度 - 應用題程式 --- ## 分類進度 * 17221(Training 6674, Test 10547) * 皇穀 2012 * 若芸 2029 * 俊達 1413 --- ## 應用題程式 ---- ### `QuestionPatternForm.cs` ```csharp=667 // -----------切換到應用題---------- Console.WriteLine(qData); string[] 有值的label集合 = new string[] { "時間量", "速率", "長度"}; string[] 參數清單 = new string[] { "船速", "水速", "順水速度", "逆水速度", "距離", "順水時間", "逆水時間"}; var 參數字典 = new Dictionary<string, string>(); foreach(var 參數 in 參數清單) { 參數字典[參數] = ""; } ``` ---- ```csharp=680 for (int i = 0; i < qData.mLsDataList.Count; i++) { var lOrder = qData.mLsDataList[i].getLabelOrder(); var vOrder = qData.mLsDataList[i].getValueOrder(); var 目標參數 = qData.mTypeSequence[i]; foreach (var entry in lOrder) { if (有值的label集合.Contains(entry.Value)) { 參數字典[目標參數] = vOrder[entry.Key]; } } } ``` ---- ```csharp=693 foreach (var 參數 in 參數字典) { Console.WriteLine(參數.Key); Console.WriteLine(參數.Value); } ValueWithUnit b = new ValueWithUnit(參數字典["順水時間"]); ValueWithUnit a = new ValueWithUnit(3.0); a.setUnit("公里"); a.setByUnit("小時"); ValueWithUnit c = a.valueOpearte("*", b); Console.WriteLine(c.getValueString()); ``` --- ### `ValueWithUnit.cs` ```csharp=123 public ValueWithUnit(string text) { string value = text; AVDataConvert avConvert = new AVDataConvert(); string number = ""; string unit = ""; ValueWithUnit valueUnit = null; avConvert.splitNumberAndUnit( value, out number, out unit ); if(unit=="") { mText = text; } else if (number == "") { unit = unit.Replace("幾", ""); unit = unit.Replace("多少", ""); mUnit = unit; } else if (FractionUnit.TryParse( number, out FractionUnit fraction )) { if (fraction != null) { valueUnit = new ValueWithUnit(fraction); } mValue = fraction; mUnit = unit; } } ```
{"metaMigratedAt":"2023-06-15T21:14:29.599Z","metaMigratedFrom":"YAML","title":"Weekly Meeting 3/16","breaks":true,"slideOptions":"{\"transition\":\"slide\"}","contributors":"[{\"id\":\"62e36997-69dd-4830-b567-1b6decba8ab1\",\"add\":2236,\"del\":362},{\"id\":\"35dabed6-7dfb-4ac3-8e6a-858efe91a445\",\"add\":319,\"del\":6},{\"id\":\"325cb9a2-2cc4-4308-8e12-b079922d655c\",\"add\":7,\"del\":0}]"}
    186 views
   Owned this note