package com.itheima.Test1; import java.util.Scanner; public class Test1 { public static void main(String[] args) { //3.录入购买信息,调用方法得到最终结果。 Scanner sc = new Scanner(System.in); System.out.println("机票原价:"); double price = sc.nextDouble(); System.out.println("月份:"); int month = sc.nextInt(); System.out.println("仓位类型(头等舱、经济舱) :"); String type = sc.next(); double rs = calc(price, month , type); System.out.println("您当前购买机票的价格是:" + rs); }
黑马JAVA P60 编程思维训练 ;案例1:买飞机票
最新推荐文章于 2023-03-04 11:01:52 发布