文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > Exercise1
侵权投诉

Exercise1

SSD3exercise1答案

and uses:

o Wrapper classes to read numerical data

o StringTokenizer to parse a line with multiple values

o Exceptions to handle malformed data

o Control structures to control the reading of data

Background

This assignment asks you to complete an application that adds products to an electronic shopping cart. The application uses three classes: Product, ShoppingCart, and ShoppingCartApplication. Part of the work has been done for you and is provided in the student archive. You will implement the method in ShoppingCartApplication that reads product information from the keyboard and creates a Product object. Description

The application presents the user with a menu of options and prompts the user for a choice:

Choice 0 terminates the program.

Choice 1 adds a product to the shopping cart.

Choice 2 displays the information of all the products stored in the shopping cart.

Choice 3 displays the total cost of all the products in the shopping cart.

To add a product, the user enters a line with the following format:name_quntity_price

Where:

name is the name of the product. quantity is the quantity of the product. price is the price of the product.

The fields are delimited by an underscore ( _ ). If the user's input is invalid, the application displays an error message.

The following is a screen shot of the application after some products have been added.

上一页第2页

TOP相关主题

你可能喜欢

热门文档

相关文档

  • Molding Exercise1

    暂无评价 8页 免费 口译与听力exercise1-5 5页 2财富值 exercise1-3 暂无评价 8页 5财富值 ssd8 Exercise1 23页 5财富值...

  • EXERCISE1-8

    ssd8 Exercise1 23页 5财富值 江苏省如皋市石庄初中八年... 暂无评价 3页 2财富值 exercise1 3页 8财富值 exercise1 2页 免费 exercise1 4页 5财富值...

  • exercise1

    exercise1-4 暂无评价 8页 免费exercise1 暂无评价0人阅读0次下载举报文档《C 语言程序设计》第一周练习 1. 编辑...

  • exercise1

    Exercises and keys 1.酶和一般化学催化剂相比,不具有的特点是 A.具有更强的催化效能 B.具有更强的专一性 C.催化的反应无副反应 D.可在高温下进行 E.是...

  • exercise1

    5页 2财富值 EXERCISE1-8 24页 免费 ssd8 Exercise1 23页 5财富值 Classroom Exercise1 6页 免费 SSD7 exercise1 3页 免费喜欢此文档的还喜欢...

  • exercise1

    5页 2财富值 EXERCISE1-8 24页 免费 ssd8 Exercise1 23页 5财富值 Classroom Exercise1 6页 免费 SSD7 exercise1 3页 免费...

  • exercise1

    exercise1_IT/计算机_专业资料。简单实用的C语言教程 附带一些习题和答案作业提交:2010cpro01@gmail.com 作业提交: 2010cpro02@gmail.com 2010cpro04@gmail.com ...

  • exercise 1

    exercise 1 暂无评价

  • exercise 1

    exercise 1_英语_初中教育_教育专区。Exercises I. Translate the following expressions: 1.cotton piece goods 棉布(业务) 2. state-operated co...

  • exercise1

    exercise1_初一英语_英语_初中教育_教育专区 暂无评价0人阅读0次下载举报文档 exercise1_初一英语_英语_初中教育_教育专区。初一英语练习...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email