本文目录一览:
- 1、怎么测试上升星座?求方法
- 2、怎么用JSP编一个关于星座的程序
- 3、用html jsp 设计。用日期查询星座,请问我的问题出在哪里,查询不到
- 4、用html jsp 语言编写。用日期查询星座,请问我的问题在哪里,查不出来
- 5、用html jsp 语言设计。 用日期查询星座,请问我的问题出在哪里
怎么测试上升星座?求方法
给你一个网址 里面可以测太阳、月亮、上升星座,还有天顶、天底、南交、北交等。很详细的。楼主可以参考一下~
怎么用JSP编一个关于星座的程序
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; public class xingzuo extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException { res.setContentType("text/html"); res.setCharacterEncoding("GB2312"); PrintWriter out = res.getWriter(); String getmonth = req.getParameter("month"); int month = new Integer(getmonth).intValue(); String getday = req.getParameter("day"); int day = new Integer(getday).intValue(); String test=req.getParameter("T1"); boolean err=false; int xingzuonumber=0; int fenjie[]={21,19,21,21,22,22,23,24,24,24,23,22}; int zuida[]={31,29,31,30,31,30,31,31,30,31,30,31}; String xingzuo[]={"水平座","双鱼座","白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","人马座","山羊座"}; String xingge[]=new String[12]; xingge[0]="这个星座常被称为'天才星座'或'未来星座'。"; xingge[7]="处女座的特色是有丰富的知性,做事一丝不苟,"; xingge[8]="天秤座的人爱好美与和谐,也相当仁慈并富有同情心,"; xingge[9]="这个星座的人有著强烈的第六感、神秘的探视能力及吸引力,"; xingge[10]="这个星座出生的人崇尚自由、无拘无束及追求速度的感觉,"; xingge[11]="就像是只走在高山绝壁的山羊一样稳健踏实,"; out.print("html"); out.print("body bgcolor=#3300ff"); out.print("center"); if(zuida[month-1]day) { err=true; }; if(day= fenjie[month-1]) { xingzuonumber=(month%12)+1; }else{xingzuonumber=month;}; if (err) { out.print("您输入的生日有错误,请重新输入"); }else{ out.print("table border=1"+"tr"); out.print("td"); out.print("img src = 'image/"+ xingzuonumber + ".jpg'/td"); out.print("td"); out.print("您的生日是"+month+"月"+day+"日"+"您的星座是"+xingzuo[(xingzuonumber+10)%12]+"这个星座的特点是:"+xingge[(xingzuonumber+10)%12]+"font color=reda href = xingzuo.jsp点击返回首页"); } //out.print(xingzuo[0]); out.print("/tr/table/center"); out.print("/body"); out.print("/html"); } }
用html jsp 设计。用日期查询星座,请问我的问题出在哪里,查询不到
就是说:你输入一个日期要显示相应的星座对吧?
有可能是你的判断不对,你输入年月日,但是星座只要取月-日就好了,再判断这个日期在哪个星座的日期之间
用html jsp 语言编写。用日期查询星座,请问我的问题在哪里,查不出来
截图看不太清,经仔细辨别,发现有个明显的逻辑错误:
从上图看,txtDay 应该对应的是 日 ,txtMonth 对应的是 月。
用html jsp 语言设计。 用日期查询星座,请问我的问题出在哪里
截图的代码看不清。
提供示例代码供参考:
function xingzuo() {
var start = 1901, date=document.getElementById("txtDay").value, month=document.getElementById("txtMonth").value
with (document.getElementById("txtXZ")){
if (month == 1 date =20 || month == 2 date =18) {value = "水瓶座";}
//if (month == 1 date 31) {value = "Huh?";}
if (month == 2 date =19 || month == 3 date =20) {value = "双鱼座";}
//if (month == 2 date 29) {value = "Say what?";}
if (month == 3 date =21 || month == 4 date =19) {value = "白羊座";}
//if (month == 3 date 31) {value = "OK. Whatever.";}
if (month == 4 date =20 || month == 5 date =20) {value = "金牛座";}
//if (month == 4 date 30) {value = "I'm soooo sorry!";}
if (month == 5 date =21 || month == 6 date =21) {value = "双子座";}
//if (month == 5 date 31) {value = "Umm ... no.";}
if (month == 6 date =22 || month == 7 date =22) {value = "巨蟹座";}
//if (month == 6 date 30) {value = "Sorry.";}
if (month == 7 date =23 || month == 8 date =22) {value = "狮子座";}
//if (month == 7 date 31) {value = "Excuse me?";}
if (month == 8 date =23 || month == 9 date =22) {value = "室女座";}
//if (month == 8 date 31) {value = "Yeah. Right.";}
if (month == 9 date =23 || month == 10 date =22) {value = "天秤座";}
//if (month == 9 date 30) {value = "Try Again.";}
if (month == 10 date =23 || month == 11 date =21) {value = "天蝎座";}
//if (month == 10 date 31) {value = "Forget it!";}
if (month == 11 date =22 || month == 12 date =21) {value = "人马座";}
//if (month == 11 date 30) {value = "Invalid Date";}
if (month == 12 date =22 || month == 1 date =19) {value = "摩羯座";}
//if (month == 12 date 31) {value = "No way!";}
}
}
标签: jsp语言查询星座
还木有评论哦,快来抢沙发吧~