可按Ctrl+D收藏 蚂蚁资源网

蚂蚁资源网

javaweb完整项目源码(java项目开发实例)

  • 全部评论(3)
  • 免注册用户
  • 如果你是在学校,图书馆可以借到很多带光盘的书,里面有源码
  • 2021-03-25 14:25:03
  • ee
  • public class test1 { public static void main(String[] args) {   Scanner scan = new Scanner(System.in);   System.out.println("请输入本月税前工资");   double d = scan.nextDouble(); //税前工资   double sal= d - 3500; // 减去扣除数的   double salary = 0; //初始化工资   if(sal<=1500){     salary = sal*0.03;   }else if(sal<=4500){    salary = sal*0.1-105;   }else if(sal<=9000){    salary = sal*0.2-555;   }else if(sal<=35000){    salary = sal*0.25-1005;   }else if(sal<=55000){    salary = sal*0.3-2755;   }else if(sal<=80000){    salary = sal*0.35-5505;   }else{    salary = sal*0.45-13505;   }   System.out.println("个人所得税的缴纳额度为:"+salary+"元"); } }1. 尽量简化逻辑 像钱的多少 先用变量存储起来 再带入就好了2. 尽量简化代码  像输出也只用一句然后带入就好了3. 尽量自己考虑 每一点问题都是自己敲代码的过程中产生然后明白的4. 这题是我原题  我知道你在哪  既然在那了 为什么还不努力呢
  • 2021-02-12 14:35:38
  • 郭大帅
  • Java的项目源码,上传图片浏览用的java代码:<br><br>&lt;%@pagelanguage=&quot;java&quot;import=&quot;java.util.*&quot;pageEncoding=&quot;UTF-8&quot;%&gt;<br>&lt;%<br>Stringpath=request.getContextPath();<br>StringbasePath=request.getScheme()+&quot;://&quot;+request.getServerName()+&quot;:&quot;+request.getServerPort()+path+&quot;/&quot;;<br>%&gt;<br><br>&lt;!DOCTYPEHTMLPUBLIC&quot;-//W3C//DTDHTML4.01Transitional//EN&quot;&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;basehref=&quot;&lt;%=basePath%&gt;&quot;&gt;<br><br>&lt;title&gt;MyJSP'file.jsp'startingpage&lt;/title&gt;<br><br>&lt;metahttp-equiv=&quot;pragma&quot;content=&quot;no-cache&quot;&gt;<br>&lt;metahttp-equiv=&quot;cache-control&quot;content=&quot;no-cache&quot;&gt;<br>&lt;metahttp-equiv=&quot;expires&quot;content=&quot;0&quot;&gt;<br>&lt;metahttp-equiv=&quot;keywords&quot;content=&quot;keyword1,keyword2,keyword3&quot;&gt;<br>&lt;metahttp-equiv=&quot;description&quot;content=&quot;Thisismypage&quot;&gt;<br>&lt;!--<br>&lt;linkrel=&quot;stylesheet&quot;type=&quot;text/css&quot;href=&quot;styles.css&quot;&gt;<br>--&gt;<br>&lt;scriptlanguage=&quot;javascript&quot;&gt;<br>functioncheckPic(){<br>varpicPath=document.getElementById(&quot;picPath&quot;).value;<br>vartype=picPath.substring(picPath.lastIndexOf(&quot;.&quot;)+1,picPath.length).toLowerCase();<br>if(type!=&quot;jpg&quot;&amp;&amp;type!=&quot;bmp&quot;&amp;&amp;type!=&quot;gif&quot;&amp;&amp;type!=&quot;png&quot;){<br>alert(&quot;请上传正确的图片格式&quot;);<br>returnfalse;<br>}<br>returntrue;<br>}<br>//图片预览<br>functionPreviewImage(divImage,upload,width,height){<br>if(checkPic()){<br>try{<br>varimgPath;<br>//图片路径<br>varBrowser_Agent=navigator.userAgent;<br>//判断浏览器的类型<br>if(Browser_Agent.indexOf(&quot;Firefox&quot;)!=-1){<br>//火狐浏览器<br>imgPath=upload.files[0].getAsDataURL();<br>document.getElementById(divImage).innerHTML=&quot;&lt;imgid='imgPreview'src='&quot;+imgPath+&quot;'width='&quot;+width+&quot;'height='&quot;+height+&quot;'/&gt;&quot;;<br>}else{<br>//IE浏览器<br>varPreview=document.getElementById(divImage);<br>Preview.filters.item(&quot;DXImageTransform.Microsoft.AlphaImageLoader&quot;).src=upload.value;<br>Preview.style.width=width;<br>Preview.style.height=height;<br>}<br>}catch(e){<br>alert(&quot;请上传正确的图片格式&quot;);<br>}<br>}<br>}<br>&lt;/script&gt;<br><br>&lt;/head&gt;<br><br>&lt;body&gt;<br>&lt;inputtype=&quot;file&quot;id=&quot;picPath&quot;name=&quot;doc&quot;onChange=&quot;PreviewImage('Preview',this,240,180);&quot;/&gt;<br>&lt;divid=&quot;Preview&quot;style=&quot;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);&quot;&gt;<br>&lt;/div&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;
  • 2021-02-12 14:35:38
  • 商品推荐