package object;
public class SuperMarket {
String name;
String dz;
String dh;
int jg;
void show(){
System.out.println(name+"欢迎您");
}
void print(){
System.out.println("我是:"+name+"地址是:"+dz+"电话是:"+dh);
}
void discount(){
System.out.println("满足100打八五折");
System.out.println("一共"+jg+"元,打折后是:"+(jg*0.85)+"元");
}
}
package object;
public class Xue {
public static void main(String[] args) {
SuperMarket s1=new SuperMarket();
s1.name="物美超市";
s1.dz="河北省保定市莲池区南二环保定理工学院";
s1.dh="18832888978";
s1.jg=120;
s1.show();
s1.print();
s1.discount();
}
}