200字
2026-09-17 课堂任务与课后作业
2026-09-17
2026-09-17

程序运行网站:

https://www.jyshare.com/compile/10/

课堂任务/课后作业:

1、阅读教材/课讲,整理笔记,弄懂当日不懂知识点;

2、

You are developing a shopping cart system and need to calculate the total price of a product. Your task is to practice the Integer and Double classes, as well as autoboxing and unboxing.Write a Java program named ShoppingCart that completes the following tasks in the main method:

Step 1: Create an Integer variable quantity with the value 5 (autoboxing);

Create a Double variable price with the value 19.99 (autoboxing)

Step 2: Unbox quantity and price, and calculate the total price total = quantity * price.

Step 3: Use Math.round() to round the total price to two decimal places.

Step 4: Output in the following format:

请提交代码截图至问卷星https://v.wjx.cn/vm/QBhMmIz.aspx#

2026-09-17 课堂任务与课后作业
作者
Administrator
发表于
2026-09-17
License
CC BY-NC-SA 4.0

评论