这是我所要求的伪
1. Take value
2. is value double or int?
3. if so, continue in program
4. else
5. is value empty?
6. if value empty; value=0.08
7. else
8. at this stage, value is not an empty valid, or a valid double or valid int
9. user did it wrong, prompt error
10. jump to step one take value
所以对我来说这很复杂,我对此很陌生。
我一直试图这样暗示它;
while ( costscan.hasNext() )
{
double costperkm = costscan.nextDouble();
if (costperkm=double){
System.out.println("Value is double");
System.out.println("FUEL COST SAVED ");
}
else {
if(costperkm=null){
costperkm=0.08;
}
else{
}
System.out.println("FUEL COST SAVED ");
}
System.out.print("\n");
System.out.print("\n");
}
我上面的代码只是玩弄的结果,所以在这个阶段它甚至可能不再有意义。希望有人能帮忙,谢谢。