• 4回复贴,共1

【血溶于水后看不见红色】PS文件

只看楼主收藏回复

一楼给吧主


1楼2015-07-24 16:34回复
    //借书卡操作
    import java.util.Scanner;
    public class JieShuKa{
    String zhanghao,name;
    int ID,yijie,yihuan;
    int kejie=20;
    void borrow(int cash){
    if(kejie>=cash){
    kejie=kejie-cash;
    System.out.println("本次借书数为:"+cash);
    System.out.println("还可借书数为:"+kejie);
    }
    }
    void theReturn(int cash){
    yihuan=yihuan+cash;
    System.out.println("本次还书:"+cash);
    }
    }
    class BookCard extends JieShuKa{
    void bookcard(String name,String zhanghao,int ID){
    System.out.println("持卡人姓名:"+name+"持卡人账号:"+zhanghao+"身份证号:"+ID);
    }}
    public class Card {
    public static void main(String[] args){
    String name,zhanghao;
    int ID;
    int s1,s2,s3;
    Scanner ss=new Scanner(System.in);
    System.out.println("请输入持卡人姓名:");
    name=ss.nextLine();
    System.out.println("请输入持卡人账号:");
    zhanghao=ss.nextLine();
    System.out.println("请输入持卡人身份证号:");
    ID=ss.nextInt();
    BookCard str1=new BookCard();
    str1.bookcard(zhanghao, zhanghao, ID);
    JieShuKa str2=new JieShuKa();
    System.out.println("请输入本次借书数:");
    s1=ss.nextInt();
    str2.borrow(s1);
    System.out.println("请输入本次还书数:");
    s3=ss.nextInt();
    str2.theReturn(s3);
    }
    }


    来自Android客户端2楼2017-12-19 10:36
    回复
      //描述人类信息
      public class Ren{
      private String name;
      String sex;
      int age;
      int weight;
      public void Ren(String Name,String Sex,int Age,int Weight){
      this.name=Name;
      sex=Sex;
      age=Age;
      weight=Weight;
      System.out.println("人类是高级动物");}
      void walk(){
      System.out.println("人类直立行走");}
      void eat(String e){
      System.out.println("人类喜欢吃"+ e);}
      void show(){
      System.out.println("我的名字叫"+name+",性别:"+sex+",今年"+age+"岁了,"+"体重是"+weight+"kg。");
      }
      public class person{
      public void main(String args[]){
      Ren s=new Ren("王昊","男",21,60);
      s.walk();
      s.eat("肉");
      s.show();
      }
      }
      }


      来自Android客户端3楼2017-12-19 10:36
      回复
        class staff{
        private String name;
        String sex;
        public staff(){
        }
        void gongzi(){
        System.out.println("都发放工资");
        }
        }
        class worker extends staff{
        double salary;
        void workers(String e){
        System.out.println("是否发放津贴:"+e);
        }
        void gongzi(){
        System.out.println("工人发放工资");
        }
        void showInfo(String name,String sex){
        System.out.println("我是"+name+",性别"+sex);
        }
        }
        class manager extends staff{
        String transport;
        void managers(String s){
        System.out.println("是否配备交通工具:"+s);
        }
        void gongzi(){
        System.out.println("经理发放工资");
        }
        void showInfo(String name,String sex){
        System.out.println("我是"+name+",性别"+sex);
        }
        }
        public class Employee {
        public static void main(String[] args){
        worker a=new worker();
        a.workers("是");
        a.showInfo("张三","女");
        a.gongzi();
        manager b=new manager();
        b.managers("是");
        b.showInfo("李四","男");
        b.gongzi();
        }
        }


        来自Android客户端4楼2017-12-20 14:08
        回复
          public class meiqi {
          double e,a;
          double f;
          double s;
          void Mqds(){
          System.out.println("上月煤气表读数:"+e);
          System.out.println("本月煤气表读数:"+f);
          }
          void Mqjs(){
          s=f-e;
          System.out.println("本月用煤气数:"+s);
          }
          void Mqfy(){
          s=f-e;
          a=s*2;
          System.out.println("本月煤气费用:"+a);
          }
          public static void main(String args[]){
          meiqi c = new meiqi();
          c.e=150;
          c.f=300;
          c.Mqds();
          c.Mqjs();
          c.Mqfy();
          }
          }


          来自Android客户端5楼2017-12-20 14:08
          回复