 |
|
|
 |
 |
|
โจทย์การบ้านแบบเบๆ มาอีกแล้ว ทำเองเถอะหนู ง่ายขนาดนี้ พี่ทำแล้วผื่นขึ้น
|
 |
 |
 |
 |
Date :
2010-03-11 08:11:55 |
By :
tungman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พี่ตึ๋งศรี ไม่แพ้กุ้งธรรมดาค่ะ
แต่แพ้น้องกุ้ง น้องปู น้องปลาค่ะ 
|
 |
 |
 |
 |
Date :
2010-03-11 21:21:31 |
By :
blurEye |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเขียนดูเองก่อนนะครับ จะได้เป็นการฝึกไปในตัวด้วย ถ้าทำได้ งานอื่นๆ ก็จะทำได้แหละ (เริ่มมีความมั่นใจมากขึ้น สู้ๆ ครับ)
     
|
 |
 |
 |
 |
Date :
2010-03-17 13:04:22 |
By :
madoadza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือว่าผมอยากรู้การสร้างเครื่องคิดเลขที่ทำหลายๆปุ่มอ่ะคับ มันต้องเริ่มยังงัยอ่ะ
เคยทำแต่แบบ กรอกตัวเลขลง textbox1 กะ textbox2 แล้วก็กดเครื่องหมายที่ต้องการ แล้วผลลัพธ์จะมาโชว์ที่ textbox3 อ่ะคับ ช่วยอธิบายที ขอบคุณล่วงหน้าคับ
|
 |
 |
 |
 |
Date :
2011-08-03 00:35:53 |
By :
Void main |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
#include<stdio.h>
int main()
{
float a=0;
float b=0;
float c=0;
float d=0;
char e;
char r;
do
{
printf("Plesae key Number1 (+,-,x,/) Number2 )");
scanf("%f%c%f",&a,&e,&b);
switch(e)
{
case'+' :
c=a+b;
break;
case'-' :
c=a-b;
break;
case'*' :
c=a*b;
break;
case'/' :
c=a/b;
break;
default:
;}
printf("AWcer:\t %f\n",c);
scanf("%c",&r);
}
while(r!='q');
}
ไม่ทราบว่าใช่หรือป่าวอะคับ งงง
|
 |
 |
 |
 |
Date :
2011-09-20 11:04:26 |
By :
VB54 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
#include <iostream>
using namespace std;
int main()
{
int Number1, Number2;
char e;
// input two number
cout << "Enter first number : ";
cin >> Number1;
cout << "Enter second number : ";
cin >> Number2;
do
{
scanf("%c",&e);
// Diplay two add
cout << endl;
cout << "Sum " << Number1 << " + " << Number2;
cout << " = " << Number1 + Number2 << endl;
cout << endl;
cout << "Sum " << Number1 << " - " << Number2;
cout << " = " << Number1 - Number2 << endl;
cout << endl;
cout << "Sum " << Number1 << " * " << Number2;
cout << " = " << Number1 * Number2 << endl;
cout << endl;
cout << "Sum " << Number1 << " / " << Number2;
cout << " = " << Number1 / Number2 << endl;
cout << "Enter first number : ";
cin >> Number1;
cout << "Enter second number : ";
cin >> Number2;
}
while(e!='q');
cout<<"\n###END Pocess###\t"<<endl;
return (0);
}
                 
|
 |
 |
 |
 |
Date :
2011-09-20 11:07:32 |
By :
VB54 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าคุณเขียนโค้ดเครื่องคิดเลขเองได้ เเสดงว่าคุณเข้าใจเนื้อหาที่เรียนเเล้วครับ แต่ถ้าไม่ทำเองคุณก็จะไม่เข้าใจต่อไปเลื่อย ๆ
ลองทำแล้วติดปัญหาอะไรค่อยมาถามใหม่ครับ สู่ ๆ ๆ...
|
 |
 |
 |
 |
Date :
2011-09-20 17:00:53 |
By :
kimura_kenchin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
int a;
bool plus = false;
bool minus = false;
bool multiply = false;
bool divide = false;
bool power = false;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "1";
}
private void button8_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "2";
}
private void button7_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "3";
}
private void button4_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "4";
}
private void button5_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "5";
}
private void button6_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "6";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "7";
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "8";
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "9";
}
private void button19_Click(object sender, EventArgs e)
{
textBox1.Text = "";
}
private void button18_Click(object sender, EventArgs e)
{
int a = textBox1.Text.Length;
if (textBox1.Text == "")
{
textBox1.Text = "";
}
else
{
textBox1.Text = textBox1.Text.Remove(a - 1);
}
}
private void button13_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
plus = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void button17_Click(object sender, EventArgs e)
{
if (plus)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) + Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
else if (minus)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) - Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
else if (multiply)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
else if (divide)
{
if (textBox1.Text == "0")
{
textBox1.Text = "0";
}
else if (textBox1.Text != "0")
{
decimal dec = Convert.ToDecimal(textBox1.Tag) / Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
}
else if (power)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Tag);
textBox1.Text = dec.ToString();
}
return;
}
private void button14_Click(object sender, EventArgs e)
{
if (textBox1.Text.Contains("."))
{
return;
}
else
{
textBox1.Text = textBox1.Text + ".";
}
}
private void button12_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
minus = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void button11_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
multiply = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void button10_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
divide = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void button15_Click(object sender, EventArgs e)
{
if (textBox1.Text != "0")
{
if (textBox1.Text.Contains('-'))
{
textBox1.Text = textBox1.Text.Remove(0, 1);
}
else
{
textBox1.Text = "-" + textBox1.Text;
}
}
}
private void button16_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "0";
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button20_Click(object sender, EventArgs e)
{
}
private void button20_Click_1(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
power = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
}
|
 |
 |
 |
 |
Date :
2012-07-10 11:24:03 |
By :
C# |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2012-08-03 02:51:45 |
By :
redsky8 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากครับ ทำให้ตาสว่างขึ้นเยอะเลย
กะว่าจะไปตามความในตำราให้ลึกซึ้งกว่านี้
เขียนเองติดบั๊กเพียบเลย ที่ไม่ติดก็ให้ผลที่ไม่ตรง
|
 |
 |
 |
 |
Date :
2012-09-14 21:16:05 |
By :
ต้น |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
การเขียนโปรแกรมเกี่ยวกับคำสั่ง while และ do while ทำอย่างไรครับ
(C# 2010)
|
 |
 |
 |
 |
Date :
2012-09-26 23:42:27 |
By :
นี่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
6. จงเขียนโปรแกรมเครื่องคิดเลขแบบง่าย โดยมีเงื่อนไขดังนี้
1. กด a ให้เข้าโปรแกรมบวกเลข เมื่อคำนวณเรียบร้อยแล้ว
แล้วให้โปรแกรมถามว่า ต้องการจะออกจริง หรือไม่ ถ้าตอบ Y ให้ออก ถ้า ตอบ N ให้กลับไปเลือกโปรแกรมใหม่อีกครั้ง
2. กด b ให้เข้าโปรแกรมลบเลข
แล้วให้โปรแกรมถามว่า ต้องการจะออกจริง หรือไม่ ถ้าตอบ Y ให้ออก ถ้า ตอบ N ให้กลับไปเลือกโปรแกรมใหม่อีกครั้ง
3. กด c ให้เข้าโปรแกรมคูณเลข
แล้วให้โปรแกรมถามว่า ต้องการจะออกจริง หรือไม่ ถ้าตอบ Y ให้ออก ถ้า ตอบ N ให้กลับไปเลือกโปรแกรมใหม่อีกครั้ง
4. กด d ให้เข้าโปรแกรมหารเลข
แล้วให้โปรแกรมถามว่า ต้องการจะออกจริง หรือไม่ ถ้าตอบ Y ให้ออก ถ้า ตอบ N ให้กลับไปเลือกโปรแกรมใหม่อีกครั้ง
5. กด Y ให้ออกจากโปรแกรมแกรม
แล้วให้โปรแกรมถามว่า ต้องการจะออกจริง หรือไม่ ถ้าตอบ Y ให้ออก ถ้า ตอบ N ให้กลับไปเลือกโปรแกรมใหม่อีก
|
 |
 |
 |
 |
Date :
2013-02-10 15:57:11 |
By :
may |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตรง no.11 บรรทัดที่ 122 หน้าคำว่า convert นี่คืออะไรหรอคับ ?
|
 |
 |
 |
 |
Date :
2013-02-21 01:37:59 |
By :
ทิว |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปกติใน C# จะบวกกันได้จะต้องแปลงให้อยู่ในรูป DataType ที่มันสามารถบวกได้ก่อนครับ เช่น พวก String จะบวกไม่ได้
|
 |
 |
 |
 |
Date :
2013-02-24 08:51:11 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (C#)
public partial class Form1 : Form
{
//int a;
bool plus = false;
bool minus = false;
bool multiply = false;
bool divide = false;
bool power = false;
public Form1()
{
InitializeComponent();
}
private void num_0_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "0";
}
private void num_1_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "1";
}
private void num_2_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "2";
}
private void num_3_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "3";
}
private void num_4_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "4";
}
private void num_5_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "5";
}
private void num_6_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "6";
}
private void num_7_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "7";
}
private void num_8_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "8";
}
private void num_9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "9";
}
private void btnBackspace_Click(object sender, EventArgs e)
{
int a = textBox1.Text.Length;
if (textBox1.Text == "")
{
textBox1.Text = "";
}
else
{
textBox1.Text = textBox1.Text.Remove(a - 1);
}
}
private void btnClear_Click(object sender, EventArgs e)
{
//if (textBox1.Text == "")
// return;
//textBox1.Text = "";
textBox1.Clear();
}
private void button1_Click(object sender, EventArgs e)
{
if (plus)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) + Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
else if (minus)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) - Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
else if (multiply)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
else if (divide)
{
if (textBox1.Text == "0")
{
textBox1.Text = "0";
}
else if (textBox1.Text != "0")
{
decimal dec = Convert.ToDecimal(textBox1.Tag) / Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
}
else if (power)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Tag);
textBox1.Text = dec.ToString();
}
return ;
}
private void btnKoon_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
multiply = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void btnLopp_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
minus = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void btnBuak_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
textBox1.Text = (textBox1.Tag + textBox1.Text);
return;
}
else
{
plus = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void btnHan_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
divide = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}
private void btnJud_Click(object sender, EventArgs e)
{
if (textBox1.Text.Contains("."))
{
return;
}
else
{
textBox1.Text = textBox1.Text + ".";
}
}
รบกวนหน่อยครับ จากโค้ดด้านบนเป็น + - * / แต่แสดง ผลทุกครั้งต้องกด = ก่อน แล้วค่อยไป + ต่อ แต่ถ้าต้องการ + ต่อไปเลยนี่ต้องเพิ่มโค้ดอะไร อะครับ รบกวนหน่อยคับ
|
 |
 |
 |
 |
Date :
2013-04-11 10:00:47 |
By :
offonepoint |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พ่อเป็นโปรแกรมเมอร์หรอคับ เขียนซะยาว
|
 |
 |
 |
 |
Date :
2013-08-27 09:35:17 |
By :
โด้เด๋าดึ๋ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กระทู้ตั้งแต่ กี่ปีที่แล้วเนี้ย ป่านนี้เจ้าของกระทู้เทพแล้วมั้ง 
|
 |
 |
 |
 |
Date :
2013-08-27 09:52:32 |
By :
01000010 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยแนะนำโค๊ดเครื่องคิดเลขกับโค๊ดนาฬิกาหน่อยได้ไหมค่ะพอดีจำทำโปรเจ็คส่งค่ะ และควรจะใช้โปรแกรมไหนสร้างค่ะช่วยแนะนำหน่อย
|
 |
 |
 |
 |
Date :
2016-08-05 18:12:17 |
By :
mon |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|