• 39名無しさん
    2020/04/24(金) 21:52:59 ID:CnBTtB/Y0
    モンブランは345円
    ショートケーキは432円
    両方8%の税込みです。

    税抜きの本体価格を求めると
    モンブランは320円
    ショートケーキは400円
    (計算中は少数点以下、切り上げ)で

    税額は
    モンブランが25.6円
    ショートケーキが32円なので

    合額は777.6円ですが
    最後は小数点以下を切り捨てるきまりなので
    777円になります。
    0 0
  • 40名無しさん
    2020/04/24(金) 23:02:22 ID:CnBTtB/Y0
    <html><head><script>
    function op1(){a=new Array();
    a[0]="<tr><th rowspan=2>No.</th><th rowspan=2>項目</th>";
    a[0]+="<th>金額と値引き</th><th>割率</th><th>割込</th><th>税率</th><th>税込</th>";
    a[0]+="<th rowspan=2>合計</th></tr>";
    a[0]+="<tr><th>本体価格</th><th>割引</th><th>値引</th><th>課税</th><th>個計</th></tr>";
    for(var i=1;i<15;i++){
    a[i]="<tr><th rowspan=2>"+i+"</th><th rowspan=2><input type='text' name='kt-"+i+"' size='10px'></input></th>";
    a[i]+="<th><input type='text' size='3px' name='e_plus-"+i+"' value='0'></input>-<input type='text' size='3px' name='e_minus-"+i+"' value='0'></input><input type='checkbox' name='non-"+i+"'></input></th>";
    a[i]+="<th><input size='1px' name='wr-"+i+"' value='0'></input></th><th><input type='checkbox' name='won-"+i+"'></input></th>";
    a[i]+="<th><select name='zr-"+i+"'>";
    a[i]+="<option value='3'>3%</option><option value='5'>5%</option><option value='8' selected>8%</option>";
    a[i]+="<option value='10'>10%</option><option value='13'>13%</option><option value='15'>15%</option></select></th>";
    a[i]+="<th><input type='checkbox' name='zon-"+i+"'></input></th><th rowspan=2 id='mix-"+i+"'>0</th></tr>";
    a[i]+="<tr id='bgs-1'><th id='sa-"+i+"-1'>-</th><th id='sa-"+i+"-2'>-</th><th id='sa-"+i+"-3'>-</th><th id='sa-"+i+"-4'>-</th><th id='sa-"+i+"-5'>-</th></tr>";
    a[0]+=a[i];};
    a[0]+="<tr><th colspan=2><input type='button' value='tap!' onClick='zx1()'></input></th><th colspan='2' id='base-x'>本体合計</th><th id='wri-x'>割引</th><th id='point'>点数</th><th id='zei-x'>税額</th><th id='full-x'>合算</th></tr>";
    document.getElementById("element").innerHTML=a[0];};
    </script></head>
    <body onload="op1()"><table border="1" id="element">
    </table></body></html>
    0 0
  • 41名無しさん
    2020/04/24(金) 23:03:00 ID:CnBTtB/Y0
    function zx1(){da=document.all;a=new Array();
    a[0]=["01101010",[0,"e_plus-","e_minus-","non-","wr-","won-","zr-","zon-"]];
    for(var f=1;f<4;f++){a[f]=new Array();
    for(var t=1;t<15;t++){a[f][t]=new Array();

    if(f==1){for(var p=1;p<8;p++){if(a[0][0][p]=="1"){
    a[1][t][p]=Number(da(a[0][1][p]+t).value);
    }else{a[1][t][p]=da(a[0][1][p]+t).checked;};};};

    if(f==2){a[2][t][1]=a[1][t][1];if(a[1][t][7]){
    a[2][t][1]=(a[2][t][1]/(a[1][t][6]+100))*a[1][t][6];
    a[2][t][1]=a[1][t][1]-Math.floor(a[2][t][1]);};
    if(a[1][t][3]){a[2][t][1]+=a[1][t][2];};if(a[1][t][5]){
    a[2][t][2]=(a[2][t][1]/(100-a[1][t][4]))*a[1][t][4];
    a[2][t][2]=Math.ceil(a[2][t][2]);a[2][t][1]+=a[2][t][2]};
    a[2][t][2]=a[2][t][1];
    a[2][t][2]=(a[1][t][4]*0.01)*a[2][t][2];
    a[2][t][2]=Math.ceil(a[2][t][2]);a[2][t][3]=a[1][t][2];
    a[2][t][4]=(a[2][t][1]-a[2][t][2])-a[2][t][3];
    a[2][t][4]=((a[1][t][6]*0.01)*a[2][t][4])*10;
    a[2][t][4]=Math.floor(a[2][t][4]);a[2][t][4]=a[2][t][4]/10;
    a[2][t][5]=((a[2][t][1]-a[2][t][2])-a[2][t][3])+a[2][t][4];
    if(t==1){a[2][t][0]=a[2][t][5]*10;
    a[2][t][0]=Math.floor(a[2][t][0]);a[2][t][0]=a[2][t][0]/10;
    }else{a[2][t][0]=(a[2][(t-1)][0]+a[2][t][5])*10;
    a[2][t][0]=Math.floor(a[2][t][0]);a[2][t][0]=a[2][t][0]/10;};};

    if(f==3){for(var y=1;y<6;y++){
    document.getElementById("sa-"+t+"-"+y).innerHTML=a[2][t][y];};
    document.getElementById("mix-"+t).innerHTML=a[2][t][0];};

    };};};
    0 0
  • 42名無しさん
    2020/04/24(金) 23:03:53 ID:CnBTtB/Y0
    <style type="text/css"><!--
    #bgs-1 th{background-color:yellow;}
    #bgs-1 th:nth-of-type(5){background-color:lime;}
    --></style>
    0 0

人気の記事