格式化的C ++输出货币值 [英] Formatted C++ Output in Monetary Values

查看:74
本文介绍了格式化的C ++输出货币值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是大一学生.科学一位主修专业的教授,希望我们通过渗透来了解知识.我们没有教科书,只有500页他的笔记.

我编写了一个模块,用于计算FICA税,但似乎无法正确输出输出.

如何格式化cout语句,使其成为输出:

1. Jones 235460 $ 123,000.00 $ 4,500.00 $ 545.00
2.史密斯3241 $ 65,000.00 $ 567.00 $ 99.98

并持续下降4行.
我看过示例,但是基本规则是什么?

请帮助.
预先感谢jim:(((

I am a first year comp. sci. major with a [word removed] professor who expects us to know stuff by osmosis. We have no textbook but 500 pages of his notes.

I have written a module that computes FICA taxes and can''t seem to get the output correct.

How does one format a cout statement such that this is the output:

1. Jones 235460 $123,000.00 $4,500.00 $545.00
2. Smith 3241 $ 65,000.00 $ 567.00 $ 99.98

and on down for 4 lines.
I have seen examples but what are the underlying rules?

Help please.
Thanks in advance, jim :((

推荐答案

123,000.00
123,000.00


4,500.00


545.00
2.史密斯3241
545.00
2. Smith 3241


这篇关于格式化的C ++输出货币值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆