| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 469 人关注过本帖
标题:求解答思路,谢谢。
取消只看楼主 加入收藏
winglesswu
Rank: 1
等 级:新手上路
帖 子:92
专家分:0
注 册:2013-1-28
结帖率:71.88%
收藏
已结贴  问题点数:20 回复次数:1 
求解答思路,谢谢。
Write a program for a restaurant called CFOOD:


1Defines should be used for price of items and taxes.

2 Program must demonstrate the use of functions where values are passed to the function or the use of pointers. Whichever is most appropriate

3 Prices are as follows:

Fish                                3.00    Chips                    2.00   

Hamburgers                          3.00    Hamburger With cheese    4.00

 Soft drinks or coffee/tea         1.00

4 There is only one tax and the tax rate is 5%

5 Program must loop until the user enters the character N, NOT a number

 

Input Screen

CFOOD FISH && CHIPS  && BURGERS

 

FOOD

How many orders of fish    ?

How many orders of chips   ?

How many hamburgers        ?

How many with cheese  ?           <<<only asked if hamburgers ordered

                                      These brackets indicate good choices for a function

DRINKS

How many soft drinks       ?

How many coffees or teas   ?

 

The output area should look like this

CSIDE FISH && CHIPS && BURGERS

 

Total Food         999.99

Total Drink        99.99

 

Total Order        999.99

 

Tax                99.99

--------------------------

Total Owing        999.99

 

Amount tendered    999.99

Change             999.99
搜索更多相关主题的帖子: coffee only restaurant function cheese 
2013-02-06 09:58
winglesswu
Rank: 1
等 级:新手上路
帖 子:92
专家分:0
注 册:2013-1-28
收藏
得分:0 
不好意思,学业太忙了。以上程序的基本意思是要为一个餐厅做顾客点餐和买单的程序,要求要用函数、循环和指针。具体步骤是:
1 输入选项:食物有 fish($3), chips($2), hamburgers($3), cheese($4)(顾客只有点了hamburgers时才询问),饮料有三种soft drinks($1), coffee/tea($1),税率为5%;
2 输出价钱选项有:total food(食物),total drink (饮料),total order(订餐总价),tax(税)、total owing(应收)、Amount tendered(收钱),change(找零)。

大概思路是有了,但是具体函数 循环 和指针相结合,小弟就有点糊涂了,请各位大侠指教,祝新年快乐,万事如意。

2013-02-09 10:46
快速回复:求解答思路,谢谢。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022635 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved