阅读以下说明和Java程序,将应填入 (n) 处的字句写在对应栏内。
[说明]
下面程序输出一个矩形面积,以及矩形区域上的假想的作物产量。
[Java程序]
public class MainJava
public static void main(String[] args)
Lot_size small=new Lot_size();
Lot_size medium=new Lot_size();
small.set(5,5,5,25);
medium.set(10,10,10,50);
System.out.println("For a small lot of area"
+small.get_area()+"\n");
System.out.println("the actual crops are $"
+small.get_data2()+"\n");
System.out.println("and ideal crops are $"
+small.get data()+"\n");
System.out.println("For a medium lot of area"
+medium.get_area()+“\n”);
System.out.println("the actual crops are $"
+medium.get_data2()+"\n");
System.out.println ("and ideal crops are $"
+medium.get_data()+"\n");
class Crop_assessment
private int actual_crop;
private int ideal_crop;
public void set(int in_actual,int in ideal)
actual_crop=in_actual;
ideal_crop=in_ideal;
public int get_actual_crop()return (1) ;
public int get_ideal_crop()(return (2) ;class Lot_size
private int length;
private int width;
private Crop_assessment crop= (3) ;
public void set(int 1,int W,int a,int i)
length=1;
width=W;
crop.set(a,i);
public int get_area()return length*width;
public int get_data()freturn (4) ;
public int get_data2()(return (5) ;