卡内基梅隆的第三册java
2022-06-13 19:49:14 40KB java ssd3 答案 选择题
1
ssd3 练习六的满分答案!
2022-05-29 22:25:22 3KB exercise6 ssd3 答案
1
卡耐基梅陇的SSD课程答案 import java.io.*; import java.util.*; /* DOCUMENT THIS CLASS */ public class ShoppingCartApplication { private static BufferedReader stdIn = new BufferedReader( new InputStreamReader(System.in)); private static PrintWriter stdOut = new PrintWriter(System.out, true); private static PrintWriter stdErr = new PrintWriter(System.err, true); private ShoppingCart cart; /* DOCUMENT THIS PUBLIC METHOD */ public static void main(String[] args) throws IOException { ShoppingCartApplication application = new ShoppingCartApplication(); application.run(); } private void run() throws IOException { cart = new ShoppingCart(); int choice = getChoice(); while (choice != 0) { if (choice == 1) { cart.addProduct(readProduct()); } else if (choice == 2) { stdOut.println(cart.toString()); } else if (choice == 3) { stdOut.println(cart.getTotalValue()); } choice = getChoice(); } } private int getChoice() throws IOException { do { int input; try { stdErr.println(); stdErr.print("[0] Quit\n" + "[1] Add Product\n" + "[2] Display Products\n" + "[3] Display Total\n" + "choice>"); stdErr.flush(); input = Integer.parseInt(stdIn.readLine()); if (0 <= input && 3 >= input) { return input; } else { stdErr.println("Invalid choice: " + input); } } catch (NumberFormatException nfe) { stdErr.println(nfe); } } while (true); } private Product readProduct() throws IOException { final String DELIM = "_"; String name = ""; int quantity = 0; double price = 0.0; /* PLACE YOUR CODE HERE */ for (;;) { try { stdErr.print("product [name_qty_price]> "); stdErr.flush(); String s = stdIn.readLine(); StringTokenizer st = new StringTokenizer(s, DELIM); if (st.countTokens() != 3) { stdErr.println("Invalid input"); } else { name = st.nextToken(); quantity = Integer.parseInt(st.nextToken()); price = Double.parseDouble(st.nextToken()); if ((quantity >= 0) && (price >= 0.0D)) { return new Product(name, quantity, price); } stdErr.println("Invalid input"); } } catch (NumberFormatException iae) { stdErr.println(iae); } } } }
2022-04-24 21:43:28 1.9MB ssd3答案 exe1 exe2 exe3
1
ssd3的所有答案,为了学弟学妹们的方便!
2022-04-10 22:33:09 1.02MB SSD3 答案 JAVA ssd3
1
复习java ssd3必备,通过ssd3课后习题的学习,可以更好地掌握面向对象的知识
2022-03-14 10:06:37 3.93MB ssd3 答案大全
1
SSD3答案,基本上包含了所有的练习,multiple choice+quiz+excercise+exam
2022-03-12 22:11:57 2.05MB SSD3 Java
1
这里有SSD3包括exercise和quiz的答案~ 很全 而且很正确 我自己也用过的~
2022-03-05 18:47:51 1.87MB 卡耐基 SSD SSD3 答案
1
完整版的答案 有需要的可以下 多多支持啊 这是第一次上传东西
2021-05-17 09:24:16 3.09MB SSD3
1
大学学习java SSD3的标准答案。 exam1 exam2 exercise1 exercise2 exercise3 exercise4 ...................
2019-12-21 22:03:14 5.77MB java SSD3答案
1
卡耐基 SSD3答案(全 eaxm+qiuz+excerise)
2019-12-21 20:03:35 1.9MB SSD3 答案 eaxm qiuz
1