所以我非常困惑,只想寻求帮助:L。这就是我老师的指导。
说明:使用标记值循环。
询问每个用户:
计算(针对每个客户):
有三种不同的租车选择,单独收费:经济舱31.76,轿车40.32,SUV 47.56。注:只考虑全天单位(不考虑小时费率)。
销售税是总额的6%。
使用以下命令创建汇总数据:
此外,还应包括IPO、算法和桌面检查值(设计文档)。
{我要做的和我的问题}
package yipe;
public class Umm {
import java.util.*;
int count = 0;
static int CarType, days;
static double DailyFee, Total;
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("What vehical would you like to rent?\n");
System.out.println("Enter 1 for an economy car\n");
System.out.println("Enter 2 for a sedan car\n");
System.out.println("Enter 3 for an SUV");
CarType = keyboard.nextInt();
if (CarType == '1')
DailyFee=(int)31.76;
else if(CarType == '2')
DailyFee=(int)40.32;
else if(CarType == '3')
DailyFee=(int)43.50;
System.out.print("Please enter the number of days rented. (Example; 3) : ");
days = keyboard.nextInt();
Total = (DailyFee * days * 6/100);
System.out.printf("The total amount due is $" + Total);
}
}
https://stackoverflow.com/questions/52999147
复制相似问题