Try   HackMD

C# 華氏與攝氏 轉換

Junter.wjs STUST MIS 丙 4A990025

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


版本一

public partial class Form1 : Form { String keyWorld = "abcdefghijklmnopqrstuvwxyz"; //防止亂數 public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text)) { MessageBox.Show("錯誤!請輸入數值", "錯誤!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else { for (int i = 0; i < keyWorld.Length; i++) { if (textBox1.Text.Contains(keyWorld.Substring(i, 1)) || textBox1.Text.Contains(keyWorld.ToUpper().Substring(i, 1))) { MessageBox.Show("請輸入正確數值", "錯誤!",MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Clear(); return; } } double ct, ft; ct = Convert.ToDouble(textBox1.Text); ft = (9.0 * ct) / 5.0 + 32; textBox2.Text = ft.ToString(); label5.Text = "==>"; button2.Enabled = false; textBox2.Enabled = false; } } private void Form1_Load(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("錯誤!請輸入數值", "錯誤!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else { for (int i = 0; i < keyWorld.Length; i++) { if (textBox2.Text.Contains(keyWorld.Substring(i, 1)) || textBox2.Text.Contains(keyWorld.ToUpper().Substring(i, 1))) { MessageBox.Show("請輸入正確數值", "錯誤!",MessageBoxButtons.OK, MessageBoxIcon.Error); textBox2.Clear(); return; } } double ct, ft; ft = Convert.ToDouble(textBox2.Text); ct = (5.0 / 9.0) * (ft - 32); textBox1.Text = ct.ToString(); label5.Text = "<=="; button1.Enabled = false; textBox1.Enabled = false; label3.Visible = true; } } private void button3_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; label5.Text = ""; textBox1.Enabled = true; textBox2.Enabled = true; button1.Enabled = true; button2.Enabled = true; textBox1.Focus(); } private void button4_Click(object sender, EventArgs e) { DialogResult Result = MessageBox.Show("您確定要關閉嗎?", "離開確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Result == DialogResult.OK) { MessageBox.Show("謝謝光臨", "哭,你走吧!", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); } else if (Result == DialogResult.Cancel) { } } }
【資歷】王俊勝待更新

個人資料

  • 91年次
  • 目前大一 就讀資訊管理系
  • 常用ID:Junter0323、御痕

經歷:

  • 網路遊戲媒體-總編輯
  • 台北國際電玩展-記者
  • 六都電競賽事-導播
  • 2018金象盃全國大數據實務能力競賽-決賽-第一名
  • 108學年度教育部全國高級中等學校電機與電子群專題-佳作
  • 107年度全國高中職學生電資類群創意競賽-銅牌獎
  • 2018愛寶盃創客機器人大賽-佳作
  • T貓盃 基礎資安能力實務競賽競賽-特優
  • T貓盃 基礎資安能力實務競賽競賽-優勝
  • 亞洲機器人大賽-佳作
  • 南科嘉南盃AI機器人競賽-佳作
  • 愛寶盃創客機器人大賽-佳作
  • 來恩盃資訊能力暨創意應用專題競賽-佳作
  • 遠大盃全國高中職校超微型創業構想競賽-佳作

未來目標:

  • 職業

    • 軟硬工程師
    • 電競賽事導播
  • 課業

  • 成就

    • FPV 飛手證照

不知道可以幹嘛的證照:

  • ICDL 國際資訊安全證照 IT Security
  • 乙級 硬體裝修
  • 乙級 軟體應用
  • 乙級 工業電子
  • 丙級 程式設計
  • 丙級 硬體裝修
  • 丙級 軟體應用
  • 丙級 工業電子

last
update:2021/3/12

程式碼如有錯誤!請自行修正。 4a990025@stust.edu.tw

Tags: C# 華氏攝氏 溫度

Copyright © 2020 Junter.Inc All Rights Reserved