文件名称:CPP
-
所属分类:
- 标签属性:
- 上传时间:2015-05-21
-
文件大小:894byte
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
编程实现下面问题:给你100元去超市购物,你买了若干花生和苹果,花生和苹果的单价及数量由键盘输入,然后把购买的花生、苹果的单价、数量、金额、总额及找零输出。
要求:
1.输入的时候总额控制不要超过100元
2.输出格式参考如下(数据自己任意输入)
XXX超市购物小票
物品名称 单价 数量 金额
花生 7.50 8.00 60.00
苹果 6.00 5.40 32.40
已收: ¥100.00元
找零: ¥7.60元
提示:cout<<fixed<<setprecision(2)<<123.456<<endl 可以输出保留小数点后两位,注意要#include<iomanip>-Programming the following question: to give you 100 yuan went shopping, you buy a number of peanuts and apples, peanuts and apples of price and quantity input the keyboard, then the peanuts to buy Apple' s unit price, quantity, amount, and the total amount of the change output. Requirements: 1. Enter the total amount of not more than 100 yuan when the control output 2. Refer to the following format (the data you enter any) XXX supermarket shopping small ticket Item Name Price Quantity Amount peanut Apple 6.00 5.40 7.50 8.00 60.00 32.40 received: ¥ 100.00 元 the change: ¥ 7.60 元 Tip: cout < <fixed<<setprecision(2)<<123.456<<endl 可以输出保留小数点后两位,注意要#include<iomanip>
要求:
1.输入的时候总额控制不要超过100元
2.输出格式参考如下(数据自己任意输入)
XXX超市购物小票
物品名称 单价 数量 金额
花生 7.50 8.00 60.00
苹果 6.00 5.40 32.40
已收: ¥100.00元
找零: ¥7.60元
提示:cout<<fixed<<setprecision(2)<<123.456<<endl 可以输出保留小数点后两位,注意要#include<iomanip>-Programming the following question: to give you 100 yuan went shopping, you buy a number of peanuts and apples, peanuts and apples of price and quantity input the keyboard, then the peanuts to buy Apple' s unit price, quantity, amount, and the total amount of the change output. Requirements: 1. Enter the total amount of not more than 100 yuan when the control output 2. Refer to the following format (the data you enter any) XXX supermarket shopping small ticket Item Name Price Quantity Amount peanut Apple 6.00 5.40 7.50 8.00 60.00 32.40 received: ¥ 100.00 元 the change: ¥ 7.60 元 Tip: cout < <fixed<<setprecision(2)<<123.456<<endl 可以输出保留小数点后两位,注意要#include<iomanip>
(系统自动生成,下载前可以参看下载内容)
下载文件列表
C++.txt
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
