Trang 2 của 4 Đầu tiênĐầu tiên 1234 CuốiCuối
Kết quả 11 đến 20 của 40
  1. #11
    Ngày tham gia
    Jan 2015
    Đang ở
    Hà Nội
    Bài viết
    2
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#ff8000]/** to change this template, choose tools | templates* and open the template in the editor.*/ /**** @author dienlh*/[/color][color=#007700]class [/color][color=#0000bb]hanghoa[/color][color=#007700]{ private [/color][color=#0000bb]string mahh[/color][color=#007700],[/color][color=#0000bb]tenhh[/color][color=#007700]; private [/color][color=#0000bb]int gia[/color][color=#007700],[/color][color=#0000bb]soluong[/color][color=#007700]; private [/color][color=#0000bb]float giamgia[/color][color=#007700]; [/color][color=#0000bb]hanghoa[/color][color=#007700](){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahh[/color][color=#007700]=[/color][color=#dd0000]"stth"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhh[/color][color=#007700]=[/color][color=#dd0000]"vang9999"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]=[/color][color=#0000bb]10[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700]=[/color][color=#0000bb]40[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giamgia[/color][color=#007700]=[/color][color=#0000bb]0.2f[/color][color=#007700]; } [/color][color=#0000bb]hanghoa[/color][color=#007700]([/color][color=#0000bb]string tenhh[/color][color=#007700],[/color][color=#0000bb]string mahh[/color][color=#007700],[/color][color=#0000bb]int gia[/color][color=#007700],[/color][color=#0000bb]int soluong[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhh[/color][color=#007700]=[/color][color=#0000bb]tenhh[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahh[/color][color=#007700]=[/color][color=#0000bb]mahh[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700]=[/color][color=#0000bb]gia[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]=[/color][color=#0000bb]soluong[/color][color=#007700]; } [/color][color=#0000bb]hanghoa[/color][color=#007700]([/color][color=#0000bb]string tenhh[/color][color=#007700],[/color][color=#0000bb]string mahh[/color][color=#007700],[/color][color=#0000bb]int gia[/color][color=#007700],[/color][color=#0000bb]int soluong[/color][color=#007700],[/color][color=#0000bb]float giamgia[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhh[/color][color=#007700]=[/color][color=#0000bb]tenhh[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahh[/color][color=#007700]=[/color][color=#0000bb]mahh[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700]=[/color][color=#0000bb]gia[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]=[/color][color=#0000bb]soluong[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giamgia[/color][color=#007700]=[/color][color=#0000bb]giamgia[/color][color=#007700]; } public [/color][color=#0000bb]int hoadon[/color][color=#007700]([/color][color=#0000bb]int gia[/color][color=#007700],[/color][color=#0000bb]int soluong[/color][color=#007700]){ return [/color][color=#0000bb]gia[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]; } public [/color][color=#0000bb]float hoadon[/color][color=#007700]([/color][color=#0000bb]int gia[/color][color=#007700],[/color][color=#0000bb]int soluong[/color][color=#007700],[/color][color=#0000bb]float giamgia[/color][color=#007700]){ return [/color][color=#0000bb]gia[/color][color=#007700]*([/color][color=#0000bb]1[/color][color=#007700]-[/color][color=#0000bb]giamgia[/color][color=#007700])*[/color][color=#0000bb]soluong[/color][color=#007700]; } public [/color][color=#0000bb]void nhaptt[/color][color=#007700](){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahh[/color][color=#007700]=[/color][color=#dd0000]"stth"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhh[/color][color=#007700]=[/color][color=#dd0000]"vang9999"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]=[/color][color=#0000bb]10[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700]=[/color][color=#0000bb]40[/color][color=#007700]; } public [/color][color=#0000bb]void intt[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]hoadon[/color][color=#007700]([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700],[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700])); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]hoadon[/color][color=#007700]([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700],[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700],[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giamgia[/color][color=#007700])); }}public class [/color][color=#0000bb]qlhh [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]){ [/color][color=#0000bb]hanghoa h[/color][color=#007700]=new [/color][color=#0000bb]hanghoa[/color][color=#007700](); [/color][color=#0000bb]h[/color][color=#007700].[/color][color=#0000bb]nhaptt[/color][color=#007700](); [/color][color=#0000bb]h[/color][color=#007700].[/color][color=#0000bb]intt[/color][color=#007700](); }}[/color] 
    </blockquote></div>
    </div>
    </div>

  2. #12
    Ngày tham gia
    Oct 2014
    Bài viết
    0
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    package ede[/color][color=#007700].[/color][color=#0000bb]cacbt[/color][color=#007700].[/color][color=#0000bb]kien[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; class [/color][color=#0000bb]banhang [/color][color=#007700]{private [/color][color=#0000bb]string tenhang[/color][color=#007700];private [/color][color=#0000bb]string mahang[/color][color=#007700];private [/color][color=#0000bb]float giaban[/color][color=#007700];private [/color][color=#0000bb]int soluong[/color][color=#007700];private [/color][color=#0000bb]float giamgia[/color][color=#007700]; public [/color][color=#0000bb]void settenhang[/color][color=#007700]([/color][color=#0000bb]string tenhang[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhang[/color][color=#007700]=[/color][color=#0000bb]tenhang[/color][color=#007700];}public [/color][color=#0000bb]string gettenhang[/color][color=#007700](){return [/color][color=#0000bb]tenhang[/color][color=#007700];}public [/color][color=#0000bb]void setmahang[/color][color=#007700]([/color][color=#0000bb]string mahang[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahang[/color][color=#007700]=[/color][color=#0000bb]mahang[/color][color=#007700];}public [/color][color=#0000bb]string getmahang[/color][color=#007700](){return [/color][color=#0000bb]mahang[/color][color=#007700];}public [/color][color=#0000bb]void setgiaban[/color][color=#007700]([/color][color=#0000bb]float giaban[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giaban[/color][color=#007700]=[/color][color=#0000bb]giaban[/color][color=#007700]; }public [/color][color=#0000bb]float getgiaban[/color][color=#007700](){return [/color][color=#0000bb]giaban[/color][color=#007700]; }public [/color][color=#0000bb]void setsoluong[/color][color=#007700]([/color][color=#0000bb]int soluong[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]=[/color][color=#0000bb]soluong[/color][color=#007700];}public [/color][color=#0000bb]int getsoluong[/color][color=#007700](){return [/color][color=#0000bb]soluong[/color][color=#007700];}public [/color][color=#0000bb]void setgiamgia[/color][color=#007700]([/color][color=#0000bb]float giamgia[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giamgia[/color][color=#007700]=[/color][color=#0000bb]giamgia[/color][color=#007700];}public [/color][color=#0000bb]float getgiamgia[/color][color=#007700](){return [/color][color=#0000bb]giamgia[/color][color=#007700];}public [/color][color=#0000bb]float banghang[/color][color=#007700]([/color][color=#0000bb]float giaban[/color][color=#007700],[/color][color=#0000bb]int soluong[/color][color=#007700]){return [/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]; }[/color][color=#ff8000]//overloading[/color][color=#007700]public [/color][color=#0000bb]float banghang[/color][color=#007700]([/color][color=#0000bb]float giaban[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700], [/color][color=#0000bb]float giamgia[/color][color=#007700]){return [/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]-[/color][color=#0000bb]soluong[/color][color=#007700]*[/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]giamgia[/color][color=#007700]/[/color][color=#0000bb]100[/color][color=#007700];} public [/color][color=#0000bb]void input[/color][color=#007700](){[/color][color=#0000bb]scanner nhap [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap gia san pham :"[/color][color=#007700]);[/color][color=#0000bb]setgiaban[/color][color=#007700]([/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]());[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap so luong san pham :"[/color][color=#007700]);[/color][color=#0000bb]setsoluong[/color][color=#007700]([/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]());[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap % giam gia"[/color][color=#007700]);[/color][color=#0000bb]setgiamgia[/color][color=#007700]([/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); }public [/color][color=#0000bb]void show[/color][color=#007700](){[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tong thanh toan hoa don: "[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"hoa don khong duoc giam"[/color][color=#007700]+[/color][color=#0000bb]banghang[/color][color=#007700]([/color][color=#0000bb]getgiaban[/color][color=#007700](), [/color][color=#0000bb]getsoluong[/color][color=#007700]()));[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"hoa don duoc giam:"[/color][color=#007700]+[/color][color=#0000bb]banghang[/color][color=#007700]([/color][color=#0000bb]getgiaban[/color][color=#007700](), [/color][color=#0000bb]getsoluong[/color][color=#007700](), [/color][color=#0000bb]getgiamgia[/color][color=#007700]()));} }public class [/color][color=#0000bb]conductordemo[/color][color=#007700]{public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) {[/color][color=#0000bb]banhang a [/color][color=#007700]= new [/color][color=#0000bb]banhang[/color][color=#007700]();[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700]();[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]show[/color][color=#007700](); }}[/color] 
    </blockquote></div>
    </div>
    </div>

  3. #13
    Ngày tham gia
    Jul 2015
    Bài viết
    11
    Mã nguồn PHP:
    [color=#000000]
    package ede[/color][color=#007700].[/color][color=#0000bb]cacbt[/color][color=#007700].[/color][color=#0000bb]kien[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; class [/color][color=#0000bb]banhang [/color][color=#007700]{private [/color][color=#0000bb]string tenhang[/color][color=#007700];private [/color][color=#0000bb]string mahang[/color][color=#007700];private [/color][color=#0000bb]float giaban[/color][color=#007700];private [/color][color=#0000bb]int soluong[/color][color=#007700];private [/color][color=#0000bb]float giamgia[/color][color=#007700]; public [/color][color=#0000bb]void settenhang[/color][color=#007700]([/color][color=#0000bb]string tenhang[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhang[/color][color=#007700]=[/color][color=#0000bb]tenhang[/color][color=#007700];}public [/color][color=#0000bb]string gettenhang[/color][color=#007700](){return [/color][color=#0000bb]tenhang[/color][color=#007700];}public [/color][color=#0000bb]void setmahang[/color][color=#007700]([/color][color=#0000bb]string mahang[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahang[/color][color=#007700]=[/color][color=#0000bb]mahang[/color][color=#007700];}public [/color][color=#0000bb]string getmahang[/color][color=#007700](){return [/color][color=#0000bb]mahang[/color][color=#007700];}public [/color][color=#0000bb]void setgiaban[/color][color=#007700]([/color][color=#0000bb]float giaban[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giaban[/color][color=#007700]=[/color][color=#0000bb]giaban[/color][color=#007700]; }public [/color][color=#0000bb]float getgiaban[/color][color=#007700](){return [/color][color=#0000bb]giaban[/color][color=#007700]; }public [/color][color=#0000bb]void setsoluong[/color][color=#007700]([/color][color=#0000bb]int soluong[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]=[/color][color=#0000bb]soluong[/color][color=#007700];}public [/color][color=#0000bb]int getsoluong[/color][color=#007700](){return [/color][color=#0000bb]soluong[/color][color=#007700];}public [/color][color=#0000bb]void setgiamgia[/color][color=#007700]([/color][color=#0000bb]float giamgia[/color][color=#007700]){[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giamgia[/color][color=#007700]=[/color][color=#0000bb]giamgia[/color][color=#007700];}public [/color][color=#0000bb]float getgiamgia[/color][color=#007700](){return [/color][color=#0000bb]giamgia[/color][color=#007700];}public [/color][color=#0000bb]float banghang[/color][color=#007700]([/color][color=#0000bb]float giaban[/color][color=#007700],[/color][color=#0000bb]int soluong[/color][color=#007700]){return [/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]; }[/color][color=#ff8000]//overloading[/color][color=#007700]public [/color][color=#0000bb]float banghang[/color][color=#007700]([/color][color=#0000bb]float giaban[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700], [/color][color=#0000bb]float giamgia[/color][color=#007700]){return [/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]-[/color][color=#0000bb]soluong[/color][color=#007700]*[/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]giamgia[/color][color=#007700]/[/color][color=#0000bb]100[/color][color=#007700];} public [/color][color=#0000bb]void input[/color][color=#007700](){[/color][color=#0000bb]scanner nhap [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap gia san pham :"[/color][color=#007700]);[/color][color=#0000bb]setgiaban[/color][color=#007700]([/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]());[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap so luong san pham :"[/color][color=#007700]);[/color][color=#0000bb]setsoluong[/color][color=#007700]([/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]());[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap % giam gia"[/color][color=#007700]);[/color][color=#0000bb]setgiamgia[/color][color=#007700]([/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); }public [/color][color=#0000bb]void show[/color][color=#007700](){[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tong thanh toan hoa don: "[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"hoa don khong duoc giam"[/color][color=#007700]+[/color][color=#0000bb]banghang[/color][color=#007700]([/color][color=#0000bb]getgiaban[/color][color=#007700](), [/color][color=#0000bb]getsoluong[/color][color=#007700]()));[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"hoa don duoc giam:"[/color][color=#007700]+[/color][color=#0000bb]banghang[/color][color=#007700]([/color][color=#0000bb]getgiaban[/color][color=#007700](), [/color][color=#0000bb]getsoluong[/color][color=#007700](), [/color][color=#0000bb]getgiamgia[/color][color=#007700]()));} }public class [/color][color=#0000bb]conductordemo[/color][color=#007700]{public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) {[/color][color=#0000bb]banhang a [/color][color=#007700]= new [/color][color=#0000bb]banhang[/color][color=#007700]();[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]input[/color][color=#007700]();[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]show[/color][color=#007700](); }}[/color] 

  4. #14
    Ngày tham gia
    Mar 2014
    Bài viết
    0
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã:
    package javaandroid.vn;
     
    public class btbai19 {
        public static void main(string[]args){
        //    donhang b=new donhang();
            system.out.println("thong tin don hang b1: ");
            donhang b1=new donhang("gao",123,20,4);
            system.out.println("thong tin don hang b2: ");
            donhang b2=new donhang("gao",123,20,4,10);
        }
    }
    class donhang{
        private string tenhang;
        private int mahang;
        private float giaban;
        private int soluong;
        private float giamgia;
       
        public donhang(){
           
        }
        public donhang(string tenhang,int mahang,float giaban,int soluong)
        {
            this.tenhang=tenhang;
            this.mahang=mahang;
            this.giaban=giaban;
            this.soluong=soluong;
            system.out.println("ten hang :"+this.tenhang);
            system.out.println("ma hang :"+this.mahang);
            system.out.println("gia ban :"+this.giaban);
            system.out.println("so luong :"+this.soluong);
            system.out.println("tong tien :"+(this.giaban*this.soluong));
        }
        public donhang(string tenhang,int mahang,float giaban,int soluong,float giamgia)
        {
            this.tenhang=tenhang;
            this.mahang=mahang;
            this.giaban=giaban;
            this.soluong=soluong;
            this.giamgia=giamgia;
            system.out.println("ten hang :"+this.tenhang);
            system.out.println("ma hang :"+this.mahang);
            system.out.println("gia ban :"+this.giaban);
            system.out.println("so luong :"+this.soluong);
            system.out.println("% giam gia :"+this.giamgia);
            system.out.println("tong tien :"+((this.giaban*this.soluong*(100-this.giamgia))/100));
        }
    }
    </blockquote></div>
    </div>
    </div>

  5. #15
    Ngày tham gia
    Oct 2014
    Bài viết
    0
    code

  6. #16
    Ngày tham gia
    Feb 2015
    Bài viết
    0
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#007700]public class [/color][color=#0000bb]hang [/color][color=#007700]{ public [/color][color=#0000bb]string ten[/color][color=#007700], [/color][color=#0000bb]ma[/color][color=#007700]; public [/color][color=#0000bb]int soluong[/color][color=#007700]; public [/color][color=#0000bb]double gia[/color][color=#007700], [/color][color=#0000bb]giam[/color][color=#007700]; public [/color][color=#0000bb]hang[/color][color=#007700]([/color][color=#0000bb]string ten[/color][color=#007700], [/color][color=#0000bb]string ma[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700], [/color][color=#0000bb]double gia[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ten [/color][color=#007700]= [/color][color=#0000bb]ten[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ma [/color][color=#007700]= [/color][color=#0000bb]ma[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]soluong[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia [/color][color=#007700]= [/color][color=#0000bb]gia[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tổng: "[/color][color=#007700]+[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700]*[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]+[/color][color=#dd0000]" $"[/color][color=#007700]); } public [/color][color=#0000bb]hang[/color][color=#007700]([/color][color=#0000bb]string ten[/color][color=#007700], [/color][color=#0000bb]string ma[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700], [/color][color=#0000bb]double gia[/color][color=#007700], [/color][color=#0000bb]double giam[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ten [/color][color=#007700]= [/color][color=#0000bb]ten[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ma [/color][color=#007700]= [/color][color=#0000bb]ma[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]soluong[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia [/color][color=#007700]= [/color][color=#0000bb]gia[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giam [/color][color=#007700]= [/color][color=#0000bb]giam[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"tổng giảm: "[/color][color=#007700]+[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]gia[/color][color=#007700]*[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]*([/color][color=#0000bb]100[/color][color=#007700]-[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giam[/color][color=#007700])/[/color][color=#0000bb]100[/color][color=#007700]+[/color][color=#dd0000]" $"[/color][color=#007700]); } } public class [/color][color=#0000bb]test [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]){ [/color][color=#0000bb]hang a [/color][color=#007700]= new [/color][color=#0000bb]hang[/color][color=#007700]([/color][color=#dd0000]"hana"[/color][color=#007700],[/color][color=#dd0000]"n123"[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700],[/color][color=#0000bb]200[/color][color=#007700]); [/color][color=#0000bb]hang b [/color][color=#007700]= new [/color][color=#0000bb]hang[/color][color=#007700]([/color][color=#dd0000]"bar"[/color][color=#007700],[/color][color=#dd0000]"147"[/color][color=#007700],[/color][color=#0000bb]6[/color][color=#007700],[/color][color=#0000bb]15[/color][color=#007700],[/color][color=#0000bb]20[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>

  7. #17
    Ngày tham gia
    Jan 2015
    Bài viết
    0
    Mã nguồn PHP:
    [color=#000000]
    tính đăng từ hôm qua nhưng mà khuya bét mắt quá[/color][color=#007700].[/color][color=#0000bb]đăng lên mọingười tham khảo thôi[/color][color=#007700]. [/color][color=#0000bb]chứ vẫn còn gà lắm[/color][color=#007700]... [/color][color=#0000bb]hì[/color][color=#007700].[/color] 
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    package structure[/color][color=#007700]; public class [/color][color=#0000bb]constructorc [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string args [/color][color=#007700][]) { [/color][color=#0000bb]things a [/color][color=#007700]= new [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#dd0000]"ho hoai kiet"[/color][color=#007700], [/color][color=#dd0000]"cntt"[/color][color=#007700], [/color][color=#0000bb]5000[/color][color=#007700], [/color][color=#0000bb]5[/color][color=#007700]); [/color][color=#0000bb]things b [/color][color=#007700]= new [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#dd0000]"hoai kiet"[/color][color=#007700], [/color][color=#dd0000]"cntt" [/color][color=#007700], [/color][color=#0000bb]5000[/color][color=#007700], [/color][color=#0000bb]6[/color][color=#007700], [/color][color=#0000bb]5[/color][color=#007700]); }} class [/color][color=#0000bb]things [/color][color=#007700]{ private [/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]serri[/color][color=#007700]; private [/color][color=#0000bb]int price[/color][color=#007700], [/color][color=#0000bb]mount[/color][color=#007700]; public [/color][color=#0000bb]things[/color][color=#007700]() { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#dd0000]"ho hoai kiet"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]serri [/color][color=#007700]= [/color][color=#dd0000]"information technology"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]price [/color][color=#007700]= [/color][color=#0000bb]5000[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mount [/color][color=#007700]= [/color][color=#0000bb]5[/color][color=#007700]; } public [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]string serri[/color][color=#007700], [/color][color=#0000bb]int price[/color][color=#007700], [/color][color=#0000bb]int mount[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]serri [/color][color=#007700]= [/color][color=#0000bb]serri[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mount [/color][color=#007700]= [/color][color=#0000bb]mount[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]price [/color][color=#007700]= [/color][color=#0000bb]price[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"name: " [/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"serri: " [/color][color=#007700]+[/color][color=#0000bb]serri[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"price: " [/color][color=#007700]+[/color][color=#0000bb]price[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"mount: " [/color][color=#007700]+[/color][color=#0000bb]mount[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"totalbill: " [/color][color=#007700]+([/color][color=#0000bb]mount[/color][color=#007700]*[/color][color=#0000bb]price[/color][color=#007700]) ); } public [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]string serri[/color][color=#007700], [/color][color=#0000bb]int price[/color][color=#007700], [/color][color=#0000bb]int mount[/color][color=#007700], [/color][color=#0000bb]int sale[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]serri [/color][color=#007700]= [/color][color=#0000bb]serri[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mount [/color][color=#007700]= [/color][color=#0000bb]mount[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]price [/color][color=#007700]= [/color][color=#0000bb]price[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"name: " [/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"serri: " [/color][color=#007700]+[/color][color=#0000bb]serri[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"price: " [/color][color=#007700]+[/color][color=#0000bb]price[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"mount: " [/color][color=#007700]+[/color][color=#0000bb]mount[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"totalbill: " [/color][color=#007700]+( [/color][color=#0000bb]mount[/color][color=#007700]*[/color][color=#0000bb]price[/color][color=#007700]* ( (float) ([/color][color=#0000bb]100[/color][color=#007700]-[/color][color=#0000bb]sale[/color][color=#007700])/[/color][color=#0000bb]100[/color][color=#007700]) ) ); } }[/color] 
    </blockquote></div>
    </div>
    </div>

  8. #18
    Ngày tham gia
    Apr 2016
    Bài viết
    0
    Mã nguồn PHP:
    [color=#000000]
    tính đăng từ hôm qua nhưng mà khuya bét mắt quá[/color][color=#007700].[/color][color=#0000bb]đăng lên mọingười tham khảo thôi[/color][color=#007700]. [/color][color=#0000bb]chứ vẫn còn gà lắm[/color][color=#007700]... [/color][color=#0000bb]hì[/color][color=#007700].[/color] 
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    package structure[/color][color=#007700]; public class [/color][color=#0000bb]constructorc [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string args [/color][color=#007700][]) { [/color][color=#0000bb]things a [/color][color=#007700]= new [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#dd0000]"ho hoai kiet"[/color][color=#007700], [/color][color=#dd0000]"cntt"[/color][color=#007700], [/color][color=#0000bb]5000[/color][color=#007700], [/color][color=#0000bb]5[/color][color=#007700]); [/color][color=#0000bb]things b [/color][color=#007700]= new [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#dd0000]"hoai kiet"[/color][color=#007700], [/color][color=#dd0000]"cntt" [/color][color=#007700], [/color][color=#0000bb]5000[/color][color=#007700], [/color][color=#0000bb]6[/color][color=#007700], [/color][color=#0000bb]5[/color][color=#007700]); }} class [/color][color=#0000bb]things [/color][color=#007700]{ private [/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]serri[/color][color=#007700]; private [/color][color=#0000bb]int price[/color][color=#007700], [/color][color=#0000bb]mount[/color][color=#007700]; public [/color][color=#0000bb]things[/color][color=#007700]() { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#dd0000]"ho hoai kiet"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]serri [/color][color=#007700]= [/color][color=#dd0000]"information technology"[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]price [/color][color=#007700]= [/color][color=#0000bb]5000[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mount [/color][color=#007700]= [/color][color=#0000bb]5[/color][color=#007700]; } public [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]string serri[/color][color=#007700], [/color][color=#0000bb]int price[/color][color=#007700], [/color][color=#0000bb]int mount[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]serri [/color][color=#007700]= [/color][color=#0000bb]serri[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mount [/color][color=#007700]= [/color][color=#0000bb]mount[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]price [/color][color=#007700]= [/color][color=#0000bb]price[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"name: " [/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"serri: " [/color][color=#007700]+[/color][color=#0000bb]serri[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"price: " [/color][color=#007700]+[/color][color=#0000bb]price[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"mount: " [/color][color=#007700]+[/color][color=#0000bb]mount[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"totalbill: " [/color][color=#007700]+([/color][color=#0000bb]mount[/color][color=#007700]*[/color][color=#0000bb]price[/color][color=#007700]) ); } public [/color][color=#0000bb]things[/color][color=#007700]([/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]string serri[/color][color=#007700], [/color][color=#0000bb]int price[/color][color=#007700], [/color][color=#0000bb]int mount[/color][color=#007700], [/color][color=#0000bb]int sale[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]serri [/color][color=#007700]= [/color][color=#0000bb]serri[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mount [/color][color=#007700]= [/color][color=#0000bb]mount[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]price [/color][color=#007700]= [/color][color=#0000bb]price[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"name: " [/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"serri: " [/color][color=#007700]+[/color][color=#0000bb]serri[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"price: " [/color][color=#007700]+[/color][color=#0000bb]price[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"mount: " [/color][color=#007700]+[/color][color=#0000bb]mount[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"totalbill: " [/color][color=#007700]+( [/color][color=#0000bb]mount[/color][color=#007700]*[/color][color=#0000bb]price[/color][color=#007700]* ( (float) ([/color][color=#0000bb]100[/color][color=#007700]-[/color][color=#0000bb]sale[/color][color=#007700])/[/color][color=#0000bb]100[/color][color=#007700]) ) ); } }[/color] 
    </blockquote></div>
    </div>
    </div>

  9. #19
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    ôi trời....

  10. #20
    Ngày tham gia
    May 2014
    Bài viết
    0
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#ff8000]//class đơn hàng có các thuộc tính: tên hàng, mã hàng, giá bán, số lượng, tỷ lệ % giảm giá.// tạo constructor có 4 thuộc tính đầu và thêm một overload constructor với 5 thuộc tính .//cả 2 constructor đều show ra tổng tiền khi các đối tượng đơn hàng được tạo ra!//(làm tương tự ví dụ trên).[/color][color=#0000bb]package bai19[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]bai19 [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]donhang a [/color][color=#007700]= new [/color][color=#0000bb]donhang[/color][color=#007700]([/color][color=#dd0000]"pepsi"[/color][color=#007700],[/color][color=#dd0000]"21a"[/color][color=#007700],[/color][color=#0000bb]6000[/color][color=#007700],[/color][color=#0000bb]12[/color][color=#007700]); [/color][color=#0000bb]donhang b [/color][color=#007700]= new [/color][color=#0000bb]donhang[/color][color=#007700]([/color][color=#dd0000]"coca"[/color][color=#007700],[/color][color=#dd0000]"21a1"[/color][color=#007700],[/color][color=#0000bb]8000[/color][color=#007700],[/color][color=#0000bb]12[/color][color=#007700],[/color][color=#0000bb]20.0f[/color][color=#007700]); }}class [/color][color=#0000bb]donhang[/color][color=#007700]{ private [/color][color=#0000bb]string tenhang[/color][color=#007700], [/color][color=#0000bb]mahang[/color][color=#007700]; private [/color][color=#0000bb]long giaban[/color][color=#007700]; private [/color][color=#0000bb]float tile[/color][color=#007700]; private [/color][color=#0000bb]int soluong[/color][color=#007700]; public [/color][color=#0000bb]donhang[/color][color=#007700]([/color][color=#0000bb]string tenhang[/color][color=#007700], [/color][color=#0000bb]string mahang[/color][color=#007700], [/color][color=#0000bb]long giaban[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhang [/color][color=#007700]= [/color][color=#0000bb]tenhang[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahang [/color][color=#007700]= [/color][color=#0000bb]mahang[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]soluong[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giaban [/color][color=#007700]= [/color][color=#0000bb]giaban[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tong tien: "[/color][color=#007700]+[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]); } public [/color][color=#0000bb]donhang[/color][color=#007700]([/color][color=#0000bb]string tenhang[/color][color=#007700], [/color][color=#0000bb]string mahang[/color][color=#007700], [/color][color=#0000bb]long giaban[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700],[/color][color=#0000bb]float tile[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tile [/color][color=#007700]= [/color][color=#0000bb]tile[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giaban [/color][color=#007700]= [/color][color=#0000bb]giaban[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]mahang [/color][color=#007700]= [/color][color=#0000bb]mahang[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]soluong[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tenhang [/color][color=#007700]= [/color][color=#0000bb]tenhang[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tong tien: "[/color][color=#007700]+([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]giaban[/color][color=#007700]*[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700]*([/color][color=#0000bb]100[/color][color=#007700]-[/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]tile[/color][color=#007700]))/[/color][color=#0000bb]100[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>

Trang 2 của 4 Đầu tiênĐầu tiên 1234 CuốiCuối

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •