https://www.myziyuan.com/
- 免注册用户
- 如果你是在学校,图书馆可以借到很多带光盘的书,里面有源码
- 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><%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%><br><%<br>Stringpath=request.getContextPath();<br>StringbasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";<br>%><br><br><!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"><br><html><br><head><br><basehref="<%=basePath%>"><br><br><title>MyJSP'file.jsp'startingpage</title><br><br><metahttp-equiv="pragma"content="no-cache"><br><metahttp-equiv="cache-control"content="no-cache"><br><metahttp-equiv="expires"content="0"><br><metahttp-equiv="keywords"content="keyword1,keyword2,keyword3"><br><metahttp-equiv="description"content="Thisismypage"><br><!--<br><linkrel="stylesheet"type="text/css"href="styles.css"><br>--><br><scriptlanguage="javascript"><br>functioncheckPic(){<br>varpicPath=document.getElementById("picPath").value;<br>vartype=picPath.substring(picPath.lastIndexOf(".")+1,picPath.length).toLowerCase();<br>if(type!="jpg"&&type!="bmp"&&type!="gif"&&type!="png"){<br>alert("请上传正确的图片格式");<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("Firefox")!=-1){<br>//火狐浏览器<br>imgPath=upload.files[0].getAsDataURL();<br>document.getElementById(divImage).innerHTML="<imgid='imgPreview'src='"+imgPath+"'width='"+width+"'height='"+height+"'/>";<br>}else{<br>//IE浏览器<br>varPreview=document.getElementById(divImage);<br>Preview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src=upload.value;<br>Preview.style.width=width;<br>Preview.style.height=height;<br>}<br>}catch(e){<br>alert("请上传正确的图片格式");<br>}<br>}<br>}<br></script><br><br></head><br><br><body><br><inputtype="file"id="picPath"name="doc"onChange="PreviewImage('Preview',this,240,180);"/><br><divid="Preview"style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);"><br></div><br><br></body><br></html>
- 2021-02-12 14:35:38