第五次作业

 

1.项目目的

设计一个能为长沙学院在校大学生的生活提供多重便利的web网站

2.项目总设计需求

我们设计的这个web网站主要实现以下几个功能a.可以根据评分、距离最近、价格最实惠等标准来查找学校周边的美食、KTV、电影院、宾馆b.可实现有偿的快递代取交易c.可查看校内新闻动态d.可实现二手物品的交易PS:只有通过认证的长沙学院在校大学生才能使用该网站

3.第一个版本计划实现的设计需求

第一个版本计划实现快递代取和二手物品交易功能。实现该功能后,寝室离快递点较远的同学可以通过该网站找他人代取;同时,毕业生也可通过该网站把二手物品出售给有需要的同学,大家的生活也会更加便利。

(1).快递代取模块实现设想:

①需要他人帮忙代取快递的同学登录网站点击快递代取模块
②填写快递信息:姓名、电话、QQ、宿舍号、代取费、快递单号、快递点名称,然后提交
③在校大学生申请接单送往指定宿舍

(2).二手物品出售实现设想:

①需要的同学登录网站点击二手物品交易模块
②填写快递信息:姓名、电话、QQ、二手物品名称配图,然后提交
③在校大学生申请执行交易

4.用户故事

作为一个网站设计者,我要统计每天有多少人访问了我的网站,即网站访问量,以便于长沙学院的大学生更加了解我的网站给他们生活能带来的便利之处,提高我们的网站的知名度,让更多的同学使用我们的网站。

5.附加

由于没什么进展,只能拿自己写的一个很基础的程序来充数了

PS:其实还没有完善
package donggeB;

import java.text.SimpleDateFormat; import java.util.*;

public class Practice {

public static void main(String []args){ 

    Date now = new Date(); 
    //可以方便地修改日期格式
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String time = dateFormat.format(now); 
    System.out.println(time); 

    //可以对每个时间域单独修改
    Calendar c = Calendar.getInstance();
    int nowYear = c.get(Calendar.YEAR); 
    int nowMonth = c.get(Calendar.MONTH) + 1; 
    int nowDate = c.get(Calendar.DATE); 
    System.out.println("今天是" + nowYear + "年" + nowMonth + "月" + nowDate + "日"); 

    //输入往年某一天所对应的年月日,判断该年是否为闰年,并计算该天距离今天的天数
    Scanner in = new Scanner(System.in);
    System.out.println("请依次输入某一年的年、月、日:");
    int year = in.nextInt();
    int month = in.nextInt();
    int date = in.nextInt();
    if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
        System.out.println(year+"年是闰年");
            }
    else{
        System.out.println(year+"年是平年");
            }

    //定义一个变量用于保存天数
            int days = 0;


    if(year == nowYear){
        if(month == nowMonth){
            if(date <= nowDate){
                days = nowDate - date;
                }
            else{
                System.out.println("输入有误!");
            }
        }
        else if(month < nowMonth){
            for(int j = month;j < nowMonth;j++){
                switch(j){
                case 1: case 3:case 5:case 7:case 8:case 10:days+=31;break;
                case 4: case 6:case 9:case 11:days+=30;
                case 2: if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
                                days+=29;
                                }
                        else{
                                days+=28;    
                                }
                break;

                    }

                }
                    days += (nowDate-date);


                }
            else{
                System.out.println("输入有误!");
            }
        }





        else if(year <= nowYear-1 ){

        if(year == nowYear-1){

            for(int j = month;j <= 12;j++){
                switch(j){
                case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                case 4: case 6:case 9:case 11:days+=30;
                case 2: if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
                                days+=29;
                                }
                        else{
                                days+=28;    
                                }
                break;

                }
                days -= date;
            }

            for(int k = 1;k < nowMonth;k++){
                switch(k){
                case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                case 4: case 6:case 9:case 11:days+=30;
                case 2: if((nowYear%400 == 0) || (nowYear%4 == 0 && nowYear%100 != 0)){
                                days+=29;
                                }
                        else{
                                days+=28;    
                                }
                break;

                }
                days += nowDate;
            }

        }
        else{
            for(int j = month;j <= 12;j++){
                switch(j){
                case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                case 4: case 6:case 9:case 11:days+=30;
                case 2: if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
                                days+=29;
                                }
                        else{
                                days+=28;    
                                }
                break;

                }
                days -= date;
            }

            for(int k = 1;k <= nowMonth;k++){
                switch(k){
                case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                case 4: case 6:case 9:case 11:days+=30;
                case 2: if((nowYear%400 == 0) || (nowYear%4 == 0 && nowYear%100 != 0)){
                                days+=29;
                                }
                        else{
                                days+=28;    
                                }
                break;

                }
                days -= nowDate;
            }

            for(int i = year+1;i < nowYear;i++){
                if((i%400 == 0) || (i%4 == 0 && i%100 != 0)){
                        days+=366;
                        }
                else{
                        days+=365;    
                        }
            }

        }

}

    else{
        System.out.println("输入有误!");
    }

    System.out.println(year + "年" + month + "月" + date + "日" + "距离今天" + days + "天");

}

}

 <h2>1.项目目的</h2><p>设计一个能为长沙学院在校大学生的生活提供多重便利的web网站</p><h2>2.项目总设计需求</h2><p>我们设计的这个web网站主要实现以下几个功能a.可以根据评分、距离最近、价格最实惠等标准来查找学校周边的美食、KTV、电影院、宾馆b.可实现有偿的快递代取交易c.可查看校内新闻动态d.可实现二手物品的交易PS:只有通过认证的长沙学院在校大学生才能使用该网站</p><h2>3.第一个版本计划实现的设计需求</h2><p>第一个版本计划实现快递代取和二手物品交易功能。实现该功能后,寝室离快递点较远的同学可以通过该网站找他人代取;同时,毕业生也可通过该网站把二手物品出售给有需要的同学,大家的生活也会更加便利。</p><h4>(1).快递代取模块实现设想:</h4><p>①需要他人帮忙代取快递的同学登录网站点击快递代取模块<br>②填写快递信息:姓名、电话、QQ、宿舍号、代取费、快递单号、快递点名称,然后提交<br>③在校大学生申请接单送往指定宿舍</p><h4>(2).二手物品出售实现设想:</h4><p>①需要的同学登录网站点击二手物品交易模块<br>②填写快递信息:姓名、电话、QQ、二手物品名称配图,然后提交<br>③在校大学生申请执行交易</p><h2>4.用户故事</h2><p>作为一个网站设计者,我要统计每天有多少人访问了我的网站,即网站访问量,以便于长沙学院的大学生更加了解我的网站给他们生活能带来的便利之处,提高我们的网站的知名度,让更多的同学使用我们的网站。</p>

<h2>5.附加</h2>
    由于没什么进展,只能拿自己写的一个很基础的程序来充数了
   PS:其实还没有完善</br>
package donggeB;

import java.text.SimpleDateFormat; 
import java.util.*;

public class Practice {

    public static void main(String []args){    
    
        Date now = new Date(); 
        //可以方便地修改日期格式
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = dateFormat.format(now); 
        System.out.println(time); 
        
        //可以对每个时间域单独修改
        Calendar c = Calendar.getInstance();
        int nowYear = c.get(Calendar.YEAR); 
        int nowMonth = c.get(Calendar.MONTH) + 1; 
        int nowDate = c.get(Calendar.DATE); 
        System.out.println("今天是" + nowYear + "年" + nowMonth + "月" + nowDate + "日"); 
        
        //输入往年某一天所对应的年月日,判断该年是否为闰年,并计算该天距离今天的天数
        Scanner in = new Scanner(System.in);
        System.out.println("请依次输入某一年的年、月、日:");
        int year = in.nextInt();
        int month = in.nextInt();
        int date = in.nextInt();
        if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
            System.out.println(year+"年是闰年");
                }
        else{
            System.out.println(year+"年是平年");
                }
        
        //定义一个变量用于保存天数
                   int days = 0;
                   
                   
        if(year == nowYear){
            if(month == nowMonth){
                if(date <= nowDate){
                    days = nowDate - date;
                    }
                else{
                    System.out.println("输入有误!");
                }
            }
            else if(month < nowMonth){
                for(int j = month;j < nowMonth;j++){
                    switch(j){
                    case 1: case 3:case 5:case 7:case 8:case 10:days+=31;break;
                    case 4: case 6:case 9:case 11:days+=30;
                    case 2: if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
                                    days+=29;
                                    }
                            else{
                                       days+=28;    
                                    }
                    break;
                    
                        }
                    
                    }
                        days += (nowDate-date);
    
                
                    }
                else{
                    System.out.println("输入有误!");
                }
            }
        
        
        
        

            else if(year <= nowYear-1 ){
            
            if(year == nowYear-1){
            
                for(int j = month;j <= 12;j++){
                    switch(j){
                    case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                    case 4: case 6:case 9:case 11:days+=30;
                    case 2: if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
                                    days+=29;
                                    }
                            else{
                                       days+=28;    
                                    }
                    break;
                    
                    }
                    days -= date;
                }
                    
                for(int k = 1;k < nowMonth;k++){
                    switch(k){
                    case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                    case 4: case 6:case 9:case 11:days+=30;
                    case 2: if((nowYear%400 == 0) || (nowYear%4 == 0 && nowYear%100 != 0)){
                                    days+=29;
                                    }
                            else{
                                       days+=28;    
                                    }
                    break;
                    
                    }
                    days += nowDate;
                }
                
            }
            else{
                for(int j = month;j <= 12;j++){
                    switch(j){
                    case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                    case 4: case 6:case 9:case 11:days+=30;
                    case 2: if((year%400 == 0) || (year%4 == 0 && year%100 != 0)){
                                    days+=29;
                                    }
                            else{
                                       days+=28;    
                                    }
                    break;
                    
                    }
                    days -= date;
                }
                    
                for(int k = 1;k <= nowMonth;k++){
                    switch(k){
                    case 1: case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                    case 4: case 6:case 9:case 11:days+=30;
                    case 2: if((nowYear%400 == 0) || (nowYear%4 == 0 && nowYear%100 != 0)){
                                    days+=29;
                                    }
                            else{
                                       days+=28;    
                                    }
                    break;
                    
                    }
                    days -= nowDate;
                }
                
                for(int i = year+1;i < nowYear;i++){
                    if((i%400 == 0) || (i%4 == 0 && i%100 != 0)){
                            days+=366;
                            }
                    else{
                               days+=365;    
                            }
                }
                
            }
                            
}
        
        else{
            System.out.println("输入有误!");
        }
        
        System.out.println(year + "年" + month + "月" + date + "日" + "距离今天" + days + "天");
        
    }

}













转载于:https://www.cnblogs.com/yourbigdongge/p/7843779.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值