文件名称:CPP
介绍说明--下载内容均来自于网络,请自行研究使用
编程实现下面问题:给你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