画法几何习题集第五版题。

李庆扬-数值分析第五版第5章习题答案(;习题,答案,版版,数值..
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
李庆扬-数值分析第五版第5章习题答案(;
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口这题目我实在是做不出来了,C++ primer plus的12章的第5题_c++吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:182,934贴子:
这题目我实在是做不出来了,C++ primer plus的12章的第5题收藏
Heather银行进行的研究表明,ATM客户不希望排队时间不超过1分钟。请使用书中程序清单12.10中的模拟,找出要使平均等候时间为1分钟,每小时到达的客户数应为多少?程序清单12.10:// queue.h -- interface for a queue// This queue will contain Customer itemsclass Customer{private:
// arrival time for customer
// processing time for customerpublic:
Customer() { arrive = processtime = 0; }
void set(long when);
long when() const { }
int ptime() const { }};typedef Customer Iclass Queue{private:// class scope definitions
// Node is a nested structure definition local to this class
struct Node { I struct Node *};
enum {Q_SIZE = 10};// private class members
// pointer to front of Queue
// pointer to rear of Queue
// current number of items in Queue
// maximum number of items in Queue
// preemptive definitions to prevent public copying
Queue(const Queue & q) : qsize(0) { }
Queue & operator=(const Queue & q) { return *}public:
Queue(int qs = Q_SIZE); // create queue with a qs limit
bool isempty()
bool isfull()
int queuecount()
bool enqueue(const Item &item); // add item to end
bool dequeue(Item &item);
// remove item from front};程序清单12.11:// queue.cpp -- Queue and Customer methods#include "queue.h"#include &cstdlib&
// (or stdlib.h) for rand()// Queue methodsQueue::Queue(int qs) : qsize(qs){
front = rear = NULL;
items = 0;}Queue::~Queue(){
while (front != NULL)
// while queue is not yet empty
// save address of front item
front = front-&// reset pointer to next item
// delete former front
}}bool Queue::isempty() const{
return items == 0;}bool Queue::isfull() const{
return items ==}int Queue::queuecount() const{}// Add item to queuebool Queue::enqueue(const Item & item){
if (isfull())
Node * add = new N
// create node
if (add == NULL)
// quit if none available
add-&item =
// set node pointers
add-&next = NULL;
if (front == NULL)
// if queue is empty,
// place item at front
rear-&next =
// else place at rear
// have rear point to new node}// Place front item into item variable and remove from queue
bool Queue::dequeue(Item & item){
if (front == NULL)
item = front-&
// set item to first item in queue
Node * temp =
// save location of first item
front = front-&
// reset front to next item
// delete former first item
if (items == 0)
rear = NULL;}// customer method// when is the time at which the customer arrives// the arrival time is set to when and the processing// time set to a random value in the range 1 - 3void Customer::set(long when){
processtime = std::rand() % 3 + 1;
arrive = }程序清单12.12:// bank.cpp -- use the Queue interface// compile with queue.cpp#include &iostream&#include &cstdlib& // for rand() and srand()#include &ctime&
// for time()#include "queue.h"const int MIN_PER_HR = 60;bool newcustomer(double x); // is there a new customer?int main(){
using std::
using std::
using std::
using std::ios_// setting things up
std::srand(std::time(0));
random initializing of rand()
cout && "Case Study: Bank of Heather Automatic Teller\n";
cout && "Enter maximum size of queue: ";
Queue line(qs);
// line queue holds up to qs people
cout && "Enter the number of simulation hours: ";
hours of simulation
// simulation will run 1 cycle per minute
long cyclelimit = MIN_PER_HR * // # of cycles
cout && "Enter the average number of customers per hour: ";
average # of arrival per hour
double min_per_
average time between arrivals
min_per_cust = MIN_PER_HR /
new customer data
long turnaways = 0;
turned away by full queue
long customers = 0;
joined the queue
long served = 0;
served during the simulation
long sum_line = 0;
cumulative line length
int wait_time = 0;
time until autoteller is free
long line_wait = 0;
cumulative time in line// running the simulation
for (int cycle = 0; cycle & cycle++)
if (newcustomer(min_per_cust))
// have newcomer
if (line.isfull())
turnaways++;
customers++;
temp.set(cycle);
// cycle = time of arrival
line.enqueue(temp); // add newcomer to line
if (wait_time &= 0 && !line.isempty())
line.dequeue (temp);
// attend next customer
wait_time = temp.ptime(); // for wait_time minutes
line_wait += cycle - temp.when();
if (wait_time & 0)
wait_time--;
sum_line += line.queuecount();
}// reporting results
if (customers & 0)
cout && "customers accepted: " && customers &&
customers served: " && served &&
turnaways: " && turnaways &&
cout && "average queue size: ";
cout.precision(2);
cout.setf(ios_base::fixed, ios_base::floatfield);
cout.setf(ios_base::showpoint);
cout && (double) sum_line / cyclelimit &&
cout && " average wait time: "
&& (double) line_wait / served && " minutes\n";
cout && "No customers!\n";
cout && "Done!\n";
return 0;}//
x = average time, in minutes, between customers//
return value is true if customer shows up this minutebool newcustomer(double x){
return (std::rand() * x / RAND_MAX & 1); }
int perhour = 1;double temp1, ave_wait=0.0; while(ave_wait &= 1.0){ min_per_cust = (double)MIN_PER_HR / ....( // running the simulation) ave_wait = (double) line_wait / if(ave_wait &= 1.0) {
temp1 = ave_
perhour++; }}ave_wait = temp1;// temp1存储上一次等待时间<1的值,因为跳出while后ave_wait值>1。只要把上面运行仿真的代码(running the simulation部分)嵌套到上面的循环代码里面去就可以了,当然前面的几句代码要稍微修改一下,比如//
cout && "Enter the average number of customers per hour: ";// // average # of arrival per hour//
cin &&这几句屏蔽掉//
min_per_cust = MIN_PER_HR /原来这句屏蔽把它加到while里面最后输出的每小时到达的客户数应为(perhour - 1)经过测试客户数基本落到25-30之间,有时候也会出现小于25或大于30的情况,甚至出现出不了结果的情况,毕竟客户去取款具有随机性,且操作时间也是随机,当出现极端的情况就出不了结果了,测试时间越长结果越准确,要是用1000小时或10000小时的话,仿真结果每小时到达的客户数就越集中,附上一张图
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或以下试题来自:
单项选择题【真题试题】(2006年单项选择第5题)
地方性法规与部门规章之间对同一事项的规定不一致,不能确定如何适用时,由国务院提出意见,国务院认为应当适用部门规章的,应当()。
A.决定适用部门规章B.提请全国人大常委会裁决C.提请全国人大裁决D.提请全国人大法律委员会裁决
你可能感兴趣试题
1A.司法解释B.立法解释C.行政解释D.政治解释2A.法律的制定机关B.法律的通过日期C.法律的实施日期D.法律的效力范围3A.省或自治区的人大常委会批准后生效B.省或自治区的人大常委会备案后生效C.全国人大常委会批准后生效D.国务院批准后生效4A.不诉免责B.时效免责C.补救免责D.议定免责5A.法规汇编具有系统性B.法规汇编不改变原有规范性文件的内容C.法规汇编可以是官方的,也可以是民间的D.法规汇编可以创造新法
热门相关试卷
最新相关试卷视频 学而思初二物理题典第一讲 第五题-[&q...
方式一:扫一扫
支持各类二维码扫描软件
方式二:发一发
免费发送App到手机
看不清验证码不正确
该短信不收取任何费用
方式三:下一下
下载App观看
还有更多攻略和游戏礼包等着你
嵌入代码:
这个支持手机播放哦
专区热点·
大家都在看
手机看视频
香巴拉女神
第一女蛮王丶饭饭《新标准英语》第五册Module1-----Module5测试题3
您现在的位置:&&>>&&>>&&>>&&>>&&>>&正文
《新标准英语》第五册Module1-----Module5测试题3
作者:佚名 资料来源:网络 点击数: &&&
《新标准英语》第五册Module1-----Module5测试题3
本资料为WORD文档,请点击下载地址下载
文章来源莲山课件 w ww.5 Y K j.Co M 《新标准英语》第五册Module1-----Module5测试题
一.选出你所听到的单词。
(& )1. When _____ you come back ?&&&& A. do&&&&&&&& B. did
(& ) 2. Yesterday I _____ to the park.&& A. went&&&&&&& B. want
(& ) 3. We need food ______ our picnic .&& A. for&&&&&& B. of
(& ) 4. ______ did you do at the weekend?& A. When&&& B. What
(& ) 5. Please give ______ the pencils.&&& A. out&&&&&&&& B. up
二.听音,排序。
(& ) 1. Did they buy ice cream?
(& ) 2. How many do you want?
(& ) 3. We visited lots of places.
(& ) 4. It’s mine. It isn’t yours.
(& ) 5. There are too many books on the desk.
三.听音,判断正( T )误( F )。
1.The dress is Ms Smart’s.&&&&&&&&&&& T&&& F
2. They came back last Saturday.&&&&&& T&&&& F
3. Daming wants five bananas.&&&&&&&& T&&& F
4. It’s Lingling’s sweater.&&&&&&&&&&&& T&&&& F
5. There are enough pencils.&&&&&&&&&& T&&&&& F
四 听音,选出正确的汉语意思。
(& ) 1. A.快点&&&&&&&&&&&&&&&& B. 多少
(& ) 2.A.冰激凌&&&&&&&&&&&&&&& B. 奶酪
(& ) 3.A. 盒&&&&&&&&&&&&&&&&&& B. 瓶
(& ) 4. A. 大英博物馆&&&&&&&&&& B. 伦敦眼
(& ) 5. A. 麻烦事&&&&&&&&&&&&&& B.小心的
Ⅱ.笔试部分
一.判断下列单词划线字母的读音是否相同,相同的打“√ ”不同的打 “×”。
1.me&&&&&&& meet&&& (& )&&&&&&&&&& 2. fish&&&&&& sit& (& )
3.good&&&&&&&& go&& (& )&&&&&&&&&& 4. coat&&&&& boat& (& )
5. morning&&&& chair& (& )
二.选出中文意思。
(& )1.when&&&&&&&&&&&&&&&&&&&&& (& ) 2. with&
(& ) 3. juice&&&&&&&&&&&&&&&&&&&&& (& )4. need&
(& )5.wonderful&&&&&&&&&&&&&&&&&& (& )6. mountain&
(& ) 7. argue&&&&&&&&&&&&&&&&&&&&& (& ) 8. whose&
(& ) 9. enough&&&&&&&&&&&&&&&&&&&& (& ) 10. give
A.谁的&&&& B. 需要&&&& C.令人惊奇的&&&& D. 和 ……一起&& E. 争吵&&& F.果汁& G. 什么时&& H. 足够的&&& I. 给&&& J.山
三.单项选择。
(& ) 1.I went to the zoo______ bus.&&&&&&&&&&&& A. by&&&& B. on
(& ) 2. How ______ oranges do you want?&&&& A. much&& B. many
(& )3. Thank you very much.& ________________.
A. You’re welcome.&&&&&&&&&&&&&& B. Welcome you
(& )4.Look! There _____ a boat on the lake.&&&&& A. is&&&& B. are
(& )5. How ____ juice do you want?&&&&&&& A. much&&&& B. many
(& )6. What’s the London Eye? It’s a big_____. A. clock&& B. wheel
(& )7. Did Lingling like the postcard? Yes, she ___. A. does& B. did
(& )8. This T-shirt is yours. ____ is yellow.&&&&&& A. My&& B. Mine
(& )9. There ______ enough bags.&&&&&&&&&& A. aren’t&&& B. isn’t
(& )10. What did you do _____ the weekend?& A. at&&&&&&&& B. on
四 选择适当的译文。
(& )1.When did you come back?
A. 你什么时候回来的?&&&&&& B.你到哪儿去了?
(& )2. How many bananas do you want?
&&& A. 你想要香蕉吗?&&&&&&&&& B. 你要多少香蕉?
(& )3.There are ten pencils in the blue box.
&&& A. 蓝色的盒子里有多少铅笔? B. 蓝色的盒子里有十支铅笔。
(& )4. Sam took my T-shirt.
&&& A. 山姆想要我的体恤衫.&&&&&& B. 山姆拿走了我的体恤衫.
(& )5.What did you do at the weekend?
&&& A.你周末做了什么?&&&&&&&&&& B. 你周末要做什么?
五 对话配对。
(& ) 1.Are there enough pencils?&&&&&&&&& A. It’s Lingling’s.
(& ) 2. Did you wash Lingling’s T-shirt?&&& B. Yes, there are enough.
(& )3. Whose bag is this?&&&&&&&&&&&&&&& C. Six, please.
(& ) 4. How did you go there?&&&&&&&&&&& D. No, I didn’t.
(& ) 5. How many bananas do you want?&&& E. By bus.
六.理解。
Yesterday was Saturday.It was sunny.I got up at 7:30. After breakfast, I went to the beach with Alice. There were many people on the beach. We ran, jumped and played volleyball on the sands. We swam in the sea. Some men fished on a boat. We had a good time. We were tired, but happy.
单词表:beach 海滩 sands 沙滩 tired 疲乏的 volleyball排球
(& )1.Yesterday was ______ .&&&&& A. Sunday&&&&& B. Saturday
(& )2. The weather was _____.&&&&& A. sunny&&&&& B. windy
(& )3. I got up at ____.&&&&&&&&&&& A. 7:00&&&&&&& B. 7:30
(& )4.I went to the beach with ______.&& A. Peter&&& B. Alice
(& ) 5. We played volleyball _____.& A. on the sands&& B. in the sea文章来源莲山课件 w ww.5 Y K j.Co M
没有相关试题上一个试题: 下一个试题:
? ? ? ? ? ? ? ? ? ?}

我要回帖

更多关于 电路第五版习题答案 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信