程式作業:The function of Decoder is converting binary number input to decimal number output. (C++)

 The function of Decoder is converting binary number input to decimal number output.

The decoder works only when "enable" is true.

Please finish the class "Decoder4_16" according to the given classes.

"Decoder4_16" should be composed of "Decoder2_4".

You could add any function if you need.

  • Decoder4_16() :create entities for class members.
  • Decoder4_16(bool) : set the value of  "enable" when declare a Decoder4_16 and create entities for class members.
  • setEnable(bool) : set the value of "enable"

  • setEnable(Gate *) : set the value of "enable"
  • setValue(bool, int) : set the value to the assigned "input". For example, a.setValue(false, 1) means that the "input[1]" of a is setting to false.
  • setValue(Gate *, int) : set the value to the assigned "input". For example, a.setValue(b, 1) means that the "input[1]" of a is b.
  • operator[ ](int) : return the the wanted output gate according to the parameter. For the example below, "dec[3]" is true, so the returned gate's output is true, assuming that dec is Decode4_16.
  • operator<<(ostream, Decoder4_16) : return all the value of the decoder. For the example below, "cout << dec" returns "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ",assuming that dec is Decode4_16.
  • output() : return the corresponding decimal value(0~15). For the example below, "output()" is 3.


////////////////////////////////////////////
/*
Decoder的作用是將輸入的二進制數轉換為十進制數輸出。

解碼器僅在“enable”為真時工作。

請根據給定的課程完成“Decoder4_16”課程。

“Decoder4_16”應該由“Decoder2_4”組成。

如果需要,您可以添加任何功能。

Decoder4_16() :為類成員創建實體。
Decoder4_16(bool) :在聲明 Decoder4_16 並為類成員創建實體時設置“enable”的值。
setEnable(bool) :設置“enable”的值
setEnable(Gate *) : 設置“enable”的值
setValue(bool, int) :將值設置為指定的“輸入”。例如,a.setValue(false, 1) 表示 a 的“input[1]”設置為 false。
setValue(Gate *, int) :將值設置為分配的“輸入”。例如a.setValue(b, 1)表示a的“input[1]”為b。
operator[ ](int) :根據參數返回想要的輸出門。對於下面的示例,“dec[3]”為真,因此返回的門的輸出為真,假設 dec 是 Decode4_16。
operator<<(ostream, Decoder4_16) :返回解碼器的所有值。對於下面的示例,“cout << dec”返回“0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0”,假設 dec 是 Decode4_16。
output() : 返回對應的十進制值(0~15)。對於下面的示例,“output()”為 3。

*/
class Gate
{
    public :
        Gate *input[2] ;
        virtual bool output() = 0 ;
  		virtual void setValue(Gate *, int) = 0 ;
        virtual void setValue(bool, int) = 0 ;
} ;

class TRUE : public Gate
{
    public :
        bool output() { return 1 ; }
        virtual void setValue(Gate *, int) {}
        virtual void setValue(bool, int) {}
} ;

class FALSE : public Gate
{
    public :
        bool output() { return 0 ; }
        virtual void setValue(Gate *, int) {}
        virtual void setValue(bool, int) {}
} ;

TRUE t ;
FALSE f ;

class NOT : public Gate
{
    public :
        bool output() { return !(this -> input[0] -> output()) ; }
        virtual void setValue(bool val, int pin = 0)
        {
        	if(val) this -> input[0] = &t ;
            else this -> input[0] = &f ;
        }
        virtual void setValue(Gate* gate, int pin = 0) { this -> input[0] = gate ; }
} ;

class NAND : public Gate
{
    public :
        bool output() { return !(this -> input[0] -> output()) || !(this -> input[1] -> output()) ; }
        virtual void setValue(Gate *gate, int pin) { this -> input[pin] = gate ; }
        virtual void setValue(bool val, int pin)
        {
            if(val) setValue(&t, pin) ;
            else setValue(&f, pin) ;
        }
} ;

class NOR : public Gate
{
    public :
        bool output() { return !(this -> input[0] -> output()) && !(this -> input[1] -> output()) ; }
        virtual void setValue(Gate *gate, int pin) { this -> input[pin] = gate ; }
        virtual void setValue(bool val, int pin)
        {
            if(val) setValue(&t, pin) ;
            else setValue(&f, pin) ;
        }
} ;

//“AND”必須由“NOT”和“NAND”組成。
  class AND : public Gate
{
    public :
        AND() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new NAND ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;

  //“OR”必須由“NOT”和“NOR”組成。
 class OR : public Gate
{
    public :
        OR() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new NOR ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;

  //“XOR” 可以由任何門組成(包括內置閘和自己實現的上面閘)。
   class XOR : public Gate
{
    public :
        XOR() : Gate()
        {
           
        }
      
		virtual bool output() { return (this -> input[0] -> output()) ^ (this -> input[1] -> output()) ; }
			          
       
    private :
       
} ;

class Decoder
{
    public :
        virtual void setValue(bool, int) = 0 ;
        virtual void setValue(Gate *, int) = 0 ;
        virtual void setEnable(bool) = 0 ;
        virtual void setEnable(Gate *) = 0 ;
        virtual int output() = 0 ;
        virtual Gate *operator[](int) = 0 ;
    protected :
        Gate *enable ;
} ;

class Decoder2_4 : public Decoder
{
    public :
        Decoder2_4() : Decoder2_4(0) {}
        Decoder2_4(bool val)
        {
            if(val) this -> enable = &t ;
            else this -> enable = &f ;
            for(int i = 0 ; i < 2 ; i++)
                component[i] = new NOT ;
            for(int i = 2 ; i < 6 ; i++)
                component[i] = new AND ;
            for(int i = 0 ; i < 4 ; i++)
                enables[i] = new AND ;
        }
        virtual void setEnable(bool val)
        {
            if(val) this -> enable = &t ;
            else this -> enable = &f ;
        }
        virtual void setEnable(Gate *gate) { this -> enable = gate ; }
        virtual void setValue(Gate *gate, int i) { component[i % 2] -> input[0] = gate ; }
        virtual void setValue(bool val, int i)
        {
            if(val) component[i % 2] -> input[0] = &t ;
            else component[i % 2] -> input[0] = &f ;
        }
        virtual Gate *operator[](int n)
        {
            _out() ;
            switch(n)
            {
                case 0 : return enables[0] ;
                case 1 : return enables[1] ;
                case 2 : return enables[2] ;
                case 3 : return enables[3] ;
                default : return nullptr ;
            }
        }
        friend ostream &operator<<(ostream &out, Decoder2_4 dec)
        {
            for(int i = 3 ; i >= 0 ; i--)
                out << dec[i] -> output() << " " ;
            return out ;
        }
        virtual int output()
        {
            for(int i = 0 ; i < 4 ; i++)
                if(enables[i] -> output()) return i ;
        }
    private :
        Gate *component[6] ;
        Gate *enables[4] ;

        void _out()
        {
            component[2] -> input[0] = component[0] ;
            component[2] -> input[1] = component[1] ;

            component[3] -> input[0] = component[0] -> input[0] ;
            component[3] -> input[1] = component[1] ;

            component[4] -> input[0] = component[0] ;
            component[4] -> input[1] = component[1] -> input[0] ;

            component[5] -> input[0] = component[0] -> input[0] ;
            component[5] -> input[1] = component[1] -> input[0] ;

            for(int i = 0 ; i < 4 ; i++)
            {
                enables[i] -> input[0] = this -> enable ;
                enables[i] -> input[1] = component[i + 2] ;
            }
        }
} ;

class Decoder4_16 : public Decoder
{
    public :
        Decoder4_16() : Decoder4_16(0) {} {}
		
		// set the value of  "enable" when declare a Decoder4_16 and create entities for class members.
        Decoder4_16(bool val) {
			
			 for(int i = 0 ; i < 5 ; i++)
                dec2_4[i] = new Decoder ;
			
			if(val) dec2_4[0] -> enable = &t ;
            else    dec2_4[0] -> enable = &f ;
			
           			
			
		}
        virtual void setEnable(bool val) {
			dec2_4[0]->setEnable(val);
		}
        virtual void setEnable(Gate *gate) {
			dec2_4[0]->setEnable(gate);   
			
		}
        virtual void setValue(bool val, int pin) {
			
			if (pin==0)      { for(int i=1;i<5;i++)  dec2_4[i]->setValue(val, 0); }
			else if (pin==1) { for(int i=1;i<5;i++)  dec2_4[i]->setValue(val, 1); }
			else if (pin==2) { dec2_4[0]->setValue(val, 0); }
			else if (pin==3) { dec2_4[0]->setValue(val, 1);}
					
			_Decode();		
		}
        virtual void setValue(Gate *gate, int pin) {
			
			if (pin==0)      { for(int i=1;i<5;i++)  dec2_4[i]->setValue(gate, 0); }
			else if (pin==1) { for(int i=1;i<5;i++)  dec2_4[i]->setValue(gate, 1); }
			else if (pin==2) { dec2_4[0]->setValue(gate, 0); }
			else if (pin==3) { dec2_4[0]->setValue(gate, 1);}
			
			_Decode();
			
		}
        virtual Gate *operator[](int n) {
			
			  switch(n)
            {
                case 0 : return dec2_4[0] ;
                case 1 : return dec2_4[1] ;
                case 2 : return dec2_4[2] ;
                case 3 : return dec2_4[3] ;
				case 4 : return dec2_4[4] ;
                default : return nullptr ;
            }
			
		}
		
		
        friend ostream &operator<<(ostream &out, Decoder4_16 dec) {
			
			  for(int i = 4 ; i >= 1 ; i--)
				  for(int j = 3 ; j >= 0 ; i--)
                    out << dec.ec2_4[i][j] -> output() << " " ;
            
			return out ;
			
		}
        
		// output() : 返回對應的十進制值(0~15)。
		int output() {
			int i,j;
			 
             i=dec2_4[1]->output() ;
			 j:= dec2_4[2]-> output(); if (j>0) i=i+4+j;
			 j:= dec2_4[3]-> output(); if (j>0) i=i+8+j;
			 j:= dec2_4[4]-> output(); if (j>0) i=i+12+j;
			 
			
			return i;
		}
    private :
        Decoder *dec2_4[5] ;
		
		
		 void _Decode()
        {
			Decoder *dec=dec2_4[0];
			
            dec2_4[1]->setEnable(dec[0]);
			dec2_4[2]->setEnable(dec[1]);
			dec2_4[3]->setEnable(dec[2]);
			dec2_4[4]->setEnable(dec[3]);
			
        }
		
} ;

程式作業:OneBitHalfAdder 及 OneBitFullAdder (C++)

 Please finish the classes "OneBitHalfAdder" and "OneBitFullAdder" according to the given classes.

"OneBitHalfAdder" must be composed of "AND" and "XOR".

"OneBitFullAdder" must be composed of "OneBitHalfAdder" and "OR".

You could add any function if you need.

Default Constructor: create new entities for "component"
sum() :return the correct sum depending on the addition of two "input" while the return value is "Gate *

  • carryOut() : return the correct carry depending on the addition of two "input" while the return value is "Gate *".
  • setValue(bool, int) : set the value to the assigned "input". For example, a.setValue(false, 1) means that the "input[1]" of a is setting to false.
  • setValue(Gate *, int) :set one gate to the assigned "input". For example, a.setValue(b, 0) means that the "input[0]" is b.
/////////////////////////////////////////////
/*
請根據給定的類完成類“OneBitHalfAdder”和“OneBitFullAdder”。

“OneBitHalfAdder”必須由“AND”和“XOR”組成。

“OneBitFullAdder”必須由“OneBitHalfAdder”和“OR”組成。

如果需要,您可以添加任何功能。
Default Constructor: create new entities for "component"
sum() :return the correct sum depending on the addition of two "input" while the return value is "Gate *"
carryOut() : return the correct carry depending on the addition of two "input" while the return value is "Gate *".
setValue(bool, int) : set the value to the assigned "input". For example, a.setValue(false, 1) means that the "input[1]" of a is setting to false.
setValue(Gate *, int) :set one gate to the assigned "input". For example, a.setValue(b, 0) means that the "input[0]" is b.
*/

class Gate
{
    public :
        Gate *input[2] ;
        virtual bool output() = 0 ;
  		void setValue(Gate *, int) ;
        void setValue(bool, int) ;
} ;

class TRUE : public Gate
{
    public :
        virtual bool output() { return 1 ; }
        void setValue(Gate *, int) {}
        void setValue(bool, int) {}
} ;

class FALSE : public Gate
{
    public :
        virtual bool output() { return 0 ; }
        void setValue(Gate *, int) {}
        void setValue(bool, int) {}
} ;

TRUE t ;
FALSE f ;

void Gate::setValue(bool val, int pin)
{
    if(val) this -> input[pin] = &t ;
    else this -> input[pin] = &f ;
}

void Gate::setValue(Gate *gate, int pin) { this -> input[pin] = gate ; }

class NOT : public Gate
{
    public :
        virtual bool output() { return !(this -> input[0] -> output()) ; }
        void setValue(bool val, int pin = 0)
        {
        	if(val) this -> input[0] = &t ;
            else this -> input[0] = &f ;
        }
        void setValue(Gate* gate, int pin = 0) { this -> input[0] = gate ; }
} ;

class NAND : public Gate
{
    public :
        virtual bool output() { return !(this -> input[0] -> output()) || !(this -> input[1] -> output()) ; }
} ;

class NOR : public Gate
{
    public :
        virtual bool output() { return !(this -> input[0] -> output()) && !(this -> input[1] -> output()) ; }
} ;


  //“AND”必須由“NOT”和“NAND”組成。
  class AND : public Gate
{
    public :
        AND() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new NAND ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;

  //“OR”必須由“NOT”和“NOR”組成。
 class OR : public Gate
{
    public :
        OR() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new NOR ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;

  //“XOR” 可以由任何門組成(包括內置閘和自己實現的上面閘)。
   class XOR : public Gate
{
    public :
        XOR() : Gate()
        {
           
        }
      
		virtual bool output() { return (this -> input[0] -> output()) ^ (this -> input[1] -> output()) ; }
			          
       
    private :
       
} ;

class Adder
{
    public :
        virtual void setValue(bool, int) = 0 ;
        virtual void setValue(Gate *, int) = 0 ;
        virtual Gate *sum() = 0 ;
        virtual Gate *carryOut() = 0 ;
} ;


// “OneBitHalfAdder”必須由“AND”和“XOR”組成。
class OneBitHalfAdder : public Adder
{
    public :
        OneBitHalfAdder() {
			
			 component[0] = new XOR ;
             component[1] = new AND ;
			
		}
        virtual void setValue(bool val, int pin) {
			
			component[0]->setValue(val, pin);
			component[1]->setValue(val, pin);
			
			
		}
        virtual void setValue(Gate *gate, int pin) {
			component[0]->setValue(gate, pin);
			component[1]->setValue(gate, pin);
						
		}
        virtual Gate *sum() { return component[0]; }
        virtual Gate *carryOut() { return component[1]; }
    private :
        Gate *component[2] ;
} ;

class OneBitFullAdder : public Adder
{
    public :
        OneBitFullAdder() {
			
			 a[0] = new OneBitHalfAdder ;
             a[1] = new OneBitHalfAdder ;
			 carry =new OR;
			
		}
        virtual void setValue(bool val, int pin) {
			
			// pin 0 =A  pin1=B  pin 2 = Cin
			
			if (pin>=0 && pin<=1) { a[0]->setValue(val,pin);  a[1]->setValue(a[0]->sum ,0);  }
			if (pin==2) { a[1]->setValue(val,1);    }
						
			
		}
        virtual void setValue(Gate *gate, int pin) {
			
			if (pin>=0 && pin<=1) { a[0]->setValue(gate,pin);  a[1]->setValue(a[0]->sum ,0);  }
			if (pin==2) { a[1]->setValue(gate,1);    }
						
		}
        virtual Gate *sum() {
			return  a[1]->sum();
		}
        virtual Gate *carryOut() {
			
			carry->setValue(a[0]->carryOut,0); carry->setValue(a[1]->carryOut,1);
			
			return  carry;
			
		}
    private :
        Adder *a[2] ;
        Gate *carry ;
} ;

程式作業: 2 questions for simulating logic gates ( C++)

 Logic gates is the basic of any computers. From now on, there will be 2 questions for simulating logic gates and their extension

1 is True and 0 is False. 

 Please finish the classes "AND", "OR" and "XOR" according to the given classes. 

 "AND" must be composed of "NOT" and "NAND". 
 "OR" must be composed of "NOT" and "NOR". 
 "XOR" can be composed of any gates (including build-in gates and above gates that implemented by yourself). 

  •  Default Constructor : create new entities for "component" 
  • output() : return the correct result depending on the two "input"
 
/*
 1 為真,0 為假。
  請根據給定的類完成類“AND”、“OR”和“XOR”。
  “AND”必須由“NOT”和“NAND”組成。
  “OR”必須由“NOT”和“NOR”組成。
  “XOR” 可以由任何門組成(包括內置閘和自己實現的上面閘)。
  
默認構造函數:為“組件”創建新實體
output() :根據兩個“輸入”返回正確的結果


*/

class Gate   // 閘
{
    public :
        Gate *input[2] ;
        virtual bool output() = 0 ;
  		void setValue(Gate *, int) ;
        void setValue(bool, int) ;
} ;

class TRUE : public Gate
{
    public :
        virtual bool output() { return 1 ; }
        void setValue(Gate *, int) {}
        void setValue(bool, int) {}
} ;

class FALSE : public Gate
{
    public :
        virtual bool output() { return 0 ; }
        void setValue(Gate *, int) {}
        void setValue(bool, int) {}
} ;

TRUE t ;
FALSE f ;

void Gate::setValue(bool val, int pin)
{
    if(val) this -> input[pin] = &t ;
    else this -> input[pin] = &f ;
}

void Gate::setValue(Gate *gate, int pin) { this -> input[pin] = gate ; }

class NOT : public Gate
{
    public :
        virtual bool output() { return !(this -> input[0] -> output()) ; }
        void setValue(bool val, int pin = 0)
        {
        	if(val) this -> input[0] = &t ;
            else this -> input[0] = &f ;
        }
        void setValue(Gate* gate, int pin = 0) { this -> input[0] = gate ; }
} ;

class NAND : public Gate
{
    public :
        virtual bool output() { return !(this -> input[0] -> output()) || !(this -> input[1] -> output()) ; }
} ;

class NOR : public Gate
{
    public :
        virtual bool output() { return !(this -> input[0] -> output()) && !(this -> input[1] -> output()) ; }
} ;





class XOR : public Gate
{
    public :
        XOR() : Gate() {}
        virtual bool output() {}
    private :
        Gate *component[5] ;
} ;
// Reference example
class XNOR : public Gate
{
    public :
        XNOR() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new XOR ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;



  //“AND”必須由“NOT”和“NAND”組成。
  class AND : public Gate
{
    public :
        AND() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new NAND ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;
  
  //“OR”必須由“NOT”和“NOR”組成。
 class OR : public Gate
{
    public :
        OR() : Gate()
        {
            component[0] = new NOT ;
            component[1] = new NOR ;
        }
        virtual bool output()
        {
            component[1] -> input[0] = this -> input[0] ;
            component[1] -> input[1] = this -> input[1] ;
            component[0] -> input[0] = component[1] ;
            return component[0] -> output() ;
        }
    private :
        Gate *component[2] ;
} ;
  
  
  //“XOR” 可以由任何門組成(包括內置閘和自己實現的上面閘)。
   class XOR : public Gate
{
    public :
        XOR() : Gate()
        {
           
        }
      
		virtual bool output() { return (this -> input[0] -> output()) ^ (this -> input[1] -> output()) ; }
			          
       
    private :
       
} ;

程式作業: 輸入學生考試成績並印出不及格人數及最高最低分數 (C++)

設計一個程式讓使用者輸入10位學生的考試成績,並分別印出不及格人數(低於60分者)最高及最低分數。

#include <stdio.h>
int main() {
   
    int d[10],i,j,amax,amin;
   amax=0; amin=100;
    j=0;
    for(i=0;i<10;i++)
    {
        printf("請輸入學生%d 成績: ",i+1);
        scanf("%d",&d[i]);
        if (d[i]>amax) amax=d[i];
        if (d[i]<amin) amin=d[i];
        if (d[i]<60) j++;
    }
  
   printf("不及格人數:%d  最高:%d 最低分數:%d",j,amax,amin);
 
    return 0; 
}   

執行結果:



程式作業:輸入一個正整數N,印出指定數列 (C++)



 
#include <stdio.h>
// 輸入一個正整數N,印出指定數列
int main() {
    int n,i,j;
    printf("請輸入一正整數:");
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    {
        for (j=1;j<=i;j++)
        {
            printf("%d",n-j+1);
        }
        printf("\n");
        
    }

    return 0;
}

執行結果:



程式作業: 水費價格程式設計 (VB)

視窗化輸出與輸入規劃,計算用水100度與程式執行結果驗證

水費費率如下表

段別

月用水度數

單價元

第一段

1-20

7.5

第二段

20-40

9.5

第三段

40-80

12

第四段

80度以上

15

 

 
Private Sub waterfee()

	' 輸入用水度
	Dim s1 As String
	s1 = InputBox("請輸入用水度", "水費計算", "0")

	v = CInt(s1)  '入用水度

	r = 0

If v >= 1 And v <= 20 Then
  r = 75
End If

If v > 20 And v <= 40 Then
  r = r + 95
End If
  
If v > 40 And v <= 80 Then
  r = r + 12
End If

If v > 80 Then
  r = r + 15
End If

 	s1 = "入用水度:" + CStr(v) + " 應繳水費:" + CStr(r)
 	MsgBox (s1)

End Sub


計算水費 執行結果:



程式作業: 報稅試算程式設計(VB)

計算收入182萬,應繳稅額稅率

級別

稅率

課稅級距

1

5%

52萬以下

2

12%

520,000~1170,000

3

20%

1170,000~2350,000

4

30%

2350,000~4400,000

5

40%

4,400000~Max

Private Sub CalculateTaxRate()

Dim v, r, t
v = 1820000
' 計算收入182萬,應繳稅額與稅率
r = 0
If v < 520000 Then
  r = 0.05 '5%
ElseIf v <= 1170000 Then
  r = 0.12 '12%  
ElseIf v <= 2350000 Then
  r = 0.2  '20%  
ElseIf v <= 4400000 Then
  r = 0.3  '30%
Else
  r = 0.4 '40%
End If

  t = v * r ',應繳稅

Dim s As String
  s = "收入182萬" + "應繳稅額:" + CStr(t) + " 稅率: " + CStr(r * 100) + "%"

  MsgBox (s)

End Sub

計算收入182萬,應繳稅額與稅率 執行結果: