lengthp.java.bak
来自「半年的java基础联系源码!现在看了破!对于初学java的朋友能帮上忙就用吧」· BAK 代码 · 共 70 行
BAK
70 行
import java.io.*;
public class LengthP
{
String miname="m";
String footname="feet";
double tran=3.2809;
void transitionMi(double foot)
{
double mi=foot/tran;
System.out.println(mi+miname);
}
void transitionFoot(double mi)
{
double foot=mi*tran;
System.out.println(foot+footname);
}
}
class TestLength
{
public static void main(String[] args)
{
String str = new String();
LengthP length1=new LengthP();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Mi to Foot!<yes or no>");
try{
str=in.readLine();
}
catch(IOException e)
{
}
if(str.equals("yes"))
{
System.out.println("please input Mi:");
try
{
double tt=Double.valueOf(in.readLine().trim()).doubleValue();
if(tt<0)
{
System.exit(-1);
}
length1.transitionFoot(tt);
}
catch(IOException e)
{
}
}
else
{
System.out.println("please input Foot:");
try
{
double tt=Double.valueOf(in.readLine().trim()).doubleValue();
length1.transitionMi(tt);
}
catch(IOException e)
{
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?