当前位置:文档之家› C++ primer plus(第6版)中文版编程练习答案第14章

C++ primer plus(第6版)中文版编程练习答案第14章

C++ primer plus(第6版)中文版编程练习答案第14章
C++ primer plus(第6版)中文版编程练习答案第14章

//winec.h

#ifndef WINEC_H_

#define WINEC_H_

#include

#include

#include

using namespace std;

template

class Pair

{

private:

T1 year;

T2 bottles;

public:

Pair(const T1 &yr, const T2 &bt) :year(yr), bottles(bt){} Pair(){}

void Set(const T1 &yr, const T2 &bt);

int Sum()const;

void Show(int y)const;

};

template

void Pair::Set(const T1 &yr, const T2 &bt)

{

year = yr;

bottles = bt;

}

template

int Pair::Sum()const

{

returnbottles.sum();

}

template

void Pair::Show(int y)const

{

for (inti = 0; i< y; i++)

cout<< "\t" << year[i] << "\t" << bottles[i] <

typedefvalarrayArrayInt;

typedef PairPairArray;

class Wine

{

private:

PairArrayyb;

stringfullname;

intyrs;

public:

Wine(){}

Wine(const char *l, int y, constintyr[], constint bot[]);

Wine(const char *l, int y);

voidGetBottles();

string&Label();

void Show()const;

int sum()const;

};

#endif

//winec.cpp

#include "winec.h"

Wine::Wine(const char *l, int y, constintyr[], constint bot[]) {

fullname = l;

yrs = y;

yb.Set(ArrayInt(yr, yrs), ArrayInt(bot, yrs));

}

Wine::Wine(const char *l, int y)

{

fullname = l;

yrs = y;

}

void Wine::GetBottles()

{

ArrayIntyr(yrs), bt(yrs);

for (inti = 0; i

{

cout<< "Enter the year: ";

cin>>yr[i];

cout<< "Enter the bottles: ";

cin>>bt[i];

}

while (cin.get() != '\n')

continue;

yb.Set(yr, bt);

}

string&Wine::Label()

{

returnfullname;

}

void Wine::Show()const

{

cout<< "Wine: " <

cout<< "\tYear\tBottles\n";

yb.Show(yrs);

}

int Wine::sum()const

{

returnyb.Sum();

}

//main.cpp

#include "winec.h"

int main(void)

{

cout<< "Enter name of wine: ";

char lab[50];

cin.getline(lab, 50);

cout<< "Enter number of years: ";

intyrs;

cin>>yrs;

Wine holding(lab, yrs);

holding.GetBottles();

holding.Show();

constint YRS = 3;

int y[YRS] = { 1993, 1995, 1998 };

int b[YRS] = { 48, 60, 72 };

Wine more("Gushing Grape Red", YRS, y, b);

more.Show();

cout<< "Total bottles for " <

cout<< "Bye\n";

system("pause");

return 0;

}

2、

//winec.h

#ifndef WINEC_H_

#define WINEC_H_

#include

#include

#include

using namespace std;

template

class Pair

{

private:

T1 year;

T2 bottles;

public:

Pair(const T1 &yr, const T2 &bt) :year(yr), bottles(bt){} Pair(){}

void Set(const T1 &yr, const T2 &bt);

int Sum()const;

void Show(int y)const;

};

template

void Pair::Set(const T1 &yr, const T2 &bt)

{

year = yr;

bottles = bt;

}

template

int Pair::Sum()const

{

returnbottles.sum();

}

template

void Pair::Show(int y)const

{

for (inti = 0; i< y; i++)

cout<< "\t" << year[i] << "\t" << bottles[i] <

}

typedefvalarrayArrayInt;

typedef PairPairArray;

class Wine :private PairArray, private string

{

private:

intyrs;

public:

Wine(){}

Wine(const char *l, int y, constintyr[], constint bot[]);

Wine(const char *l, int y);

voidGetBottles();

string&Label();

void Show()const;

int sum()const;

};

#endif

//winec.cpp

#include "winec.h"

Wine::Wine(const char *l, int y, constintyr[], constint bot[]) :string(l), yrs(y), PairArray(ArrayInt(yr, y), ArrayInt(bot, y))

{

}

Wine::Wine(const char *l, int y) : string(l), yrs(y)

{

}

void Wine::GetBottles()

{

ArrayIntyr(yrs), bt(yrs);

for (inti = 0; i

{

cout<< "Enter the year: ";

cin>>yr[i];

cout<< "Enter the bottles: ";

cin>>bt[i];

}

while (cin.get() != '\n')

continue;

PairArray::Set(yr, bt);

}

string&Wine::Label()

{

return (string &)(*this);

}

void Wine::Show()const

{

cout<< "Wine: " << (string &)(*this) <

cout<< "\tYear\tBottles\n";

PairArray::Show(yrs);

}

int Wine::sum()const

{

returnPairArray::Sum();

}

//main.cpp

#include "winec.h"

int main(void)

{

cout<< "Enter name of wine: ";

char lab[50];

cin.getline(lab, 50);

cout<< "Enter number of years: ";

intyrs;

cin>>yrs;

Wine holding(lab, yrs);

holding.GetBottles();

holding.Show();

constint YRS = 3;

int y[YRS] = { 1993, 1995, 1998 };

int b[YRS] = { 48, 60, 72 };

Wine more("Gushing Grape Red", YRS, y, b);

more.Show();

cout<< "Total bottles for " <

cout<< "Bye\n";

system("pause");

return 0;

}

3、

//queuetp.h

#ifndef QUEUETP_H_

#define QUEUETP_H_

#include

#include

#include

using namespace std;

template

classQueueTp

{

private:

struct Node { T item; struct Node *next; };

Node *front;

Node *rear;

int items;

constintqsize;

QueueTp(constQueueTp&q) :qsize(0){}

QueueTp&operator=(constQueueTp&q){ return *this; } public:

QueueTp(intqs = 10);

~QueueTp();

boolisempty()const;

boolisfull()const;

intqueuecount()const;

boolenqueue(const T &item);

booldequeue(T &item);

};

template

QueueTp::QueueTp(intqs) :qsize(qs)

{

front = rear = NULL;

items = 0;

}

template

QueueTp::~QueueTp()

{

Node *temp;

while (front != NULL)

{

temp = front;

front = front->next;

delete temp;

}

}

template

boolQueueTp::isempty()const

{

return items == 0;

}

template

boolQueueTp::isfull()const

{

return items == qsize;

}

template

intQueueTp::queuecount()const

{

return items;

}

template

boolQueueTp::enqueue(const T &item) {

if (isfull())

return false;

Node *add = new Node;

add->item = item;

add->next = NULL;

items++;

if (front == NULL)

front = add;

else

rear->next = add;

rear = add;

return true;

}

template

boolQueueTp::dequeue(T &item)

{

if (front == NULL)

return false;

item = front->item;

items--;

Node *temp = front;

front = front->next;

delete temp;

if (items == 0)

rear = NULL;

return true;

}

class Worker

{

private:

stringfullname;

long id;

public:

Worker() :fullname("no one"), id(0L){}

Worker(const string &s, long n) :fullname(s), id(n){} ~Worker();

void Set();

void Show()const;

};

#endif

//workermi.cpp

#include "queuetp.h"

Worker::~Worker(){}

void Worker::Show()const

{

cout<< "Name: " <

cout<< "Employee ID: " << id <

}

void Worker::Set()

{

cout<< "Enter worker's name: ";

getline(cin, fullname);

cout<< "Enter worker's ID: ";

cin>> id;

while (cin.get() != '\n')

continue;

}

//main.cpp

#include "queuetp.h"

constint Size = 5;

int main()

{

QueueTplolas(Size);

Worker *temp;

intct;

for (ct = 0; ct< Size; ct++)

{

charch;

cout<< "Enter the command:\n"

<< "A or a enter queue, "

<< "P or p delete queue, "

<< "Q or q quit.\n";

cin>>ch;

while (strchr("apq", ch) == NULL)

{

cout<< "Please enter a p or q: ";

cin>>ch;

}

if (ch == 'q')

break;

switch(ch)

{

case'a':

temp = new Worker;

cin.get();

temp->Set();

if (lolas.isfull())

cout<< "Queue already full\n";

else

lolas.enqueue(temp);

break;

case'p':

if (lolas.isempty())

cout<< "Queue already empty\n";

else

lolas.dequeue(temp);

break;

}

}

cout<< "\nHere the total count: ";

cout<

cout<< "Done.\n";

system("pause");

return 0;

}

4、

//person.h

#ifndef PERSON_H_

#define PERSON_H_

#include

#include

#include

#include

using namespace std;

class Person

{

private:

stringfirstname;

stringlastname;

protected:

virtual void Data()const;

virtual void Get();

public:

Person():firstname("no one"),lastname("no one"){}

Person(const string &f,const string &l):firstname(f),lastname(l){} Person(const Person &p):Person(p){}

virtual ~Person() = 0;

virtual void Set() = 0;

virtual void Show()const = 0;

};

classGunslinger:virtual public Person

{

private:

intnumsk;

protected:

void Data()const;

void Get();

public:

Gunslinger():numsk(0),Person(){}

Gunslinger(intnk, const string &f, const string &l) :numsk(nk), Person(f, l){} Gunslinger(intnk, const Person &p):numsk(nk),Person(p){}

void Show()const;

void Set();

double Draw()const;

};

classPokerPlayer:virtual public Person

{

protected:

void Data()const;

public:

PokerPlayer():Person(){}

PokerPlayer(const string &f, const string &l) : Person(f, l){}

PokerPlayer(const Person &p):Person(p){}

int Draw()const;

void Show()const;

void Set(){ Person::Set(); }

};

classBadDude:publicGunslinger,publicPokerPlayer

{

protected:

void Data()const;

void Get();

public:

BadDude(){}

BadDude(intnk , const string &f, const string &l)

:Person(f, l), Gunslinger(nk, f, l), PokerPlayer(f, l){}

BadDude(intnk, const Person &p)

:Person(p), Gunslinger(nk, p), PokerPlayer(p){}

BadDude(const Gunslinger &g)

:Person(g),Gunslinger(g),PokerPlayer(g){}

BadDude(intnk, constPokerPlayer&po)

:Person(po), Gunslinger(nk, po), PokerPlayer(po){}

doubleGdraw()const;

intCdraw()const;

void Set();

void Show()const;

};

#endif

//person.cpp

#include "person.h"

Person::~Person(){}

void Person::Data()const

{

cout<< "First name is : " <

cout<< "Last name is : " <

}

void Person::Get()

{

cout<< "Enter first name: \n";

getline(cin, firstname);

cout<< "Enter last name: \n";

getline(cin, lastname);

}

void Person::Show()const

{

Data();

}

void Person::Set()

{

Get();

}

void Gunslinger::Data()const

{

cout<< "Nick is :" <

cout<< "The time of get the gun :" << Gunslinger::Draw() <

void Gunslinger::Get()

{

cout<< "Enter Nick: \n";

cin>>numsk;

}

void Gunslinger::Set()

{

cout<< "Enter Guns name: \n";

Person::Get();

Get();

}

void Gunslinger::Show()const

{

cout<< "Gunslinger: \n";

Person::Data();

Data();

}

double Gunslinger::Draw()const

{

return rand() % 3 + 1;

}

intPokerPlayer::Draw()const

{

return rand() % 52 + 1;

}

voidPokerPlayer::Data()const

{

cout<< "The cards :" << Draw() <

voidPokerPlayer::Show()const

{

cout<< "PokerPlayer :\n";

Person::Data();

Data();

}

doubleBadDude::Gdraw()const

{

return Gunslinger::Draw();

}

intBadDude::Cdraw()const

{

returnPokerPlayer::Draw();

}

voidBadDude::Data()const

{

Gunslinger::Data();

PokerPlayer::Data();

cout<< "The next cards: " <

cout<< "The time of BadDude get the gun: " <

voidBadDude::Get()

{

Gunslinger::Get();

}

voidBadDude::Set()

{

cout<< "Enter BadDude name: \n";

Person::Get();

Get();

}

voidBadDude::Show()const

{

cout<< "BadDude: \n";

Person::Data();

Data();

}

//main.cpp

#include "person.h"

constint Size=5;

int main ()

{

Person *per[Size];

intct;

for (ct = 0; ct< Size; ct++)

{

char choice;

cout<< "Enter the Person: \n"

<< "g: gunslinger p: poker "

<< "b: bad dude q: quit\n";

cin>> choice;

while (strchr("gpbq", choice) == NULL)

{

cout<< "Please enter a p,g,o,q: ";

cin>> choice;

}

if (choice == 'q')

break;

switch (choice)

{

case'g':

per[ct] = new Gunslinger;

break;

case'p':

per[ct] = new PokerPlayer;

break;

case'b':

per[ct] = new BadDude;

break;

}

cin.get();

per[ct]->Set();

}

cout<< "\nHere is your staff:\n";

inti;

for (i = 0; i

{

cout<

per[i]->Show();

}

for (i = 0; i

delete per[i];

cout<< "Bye\n";

system("pause");

return 0;

}

5、

//emp.h

#ifndef EMP_H_

#define EMP_H_

#include

#include

using namespace std;

classabstr_emp

private:

stringfname;

stringlname;

string job;

public:

abstr_emp();

abstr_emp(const string &fn, const string &ln,

const string &j);

virtual void ShowAll()const;

virtual void SetAll();

friendostream&operator<<(ostream&os, constabstr_emp&e);

virtual ~abstr_emp() = 0;

};

class employee :public abstr_emp

{

public:

employee();

employee(const string &fn, const string &ln,

const string &j);

virtual void ShowAll()const;

virtual void SetAll();

};

class manager :virtual public abstr_emp

{

private:

intinchargeof;

protected:

intInChargeOf()const { return inchargeof; }

int&InChargeOf(){ return inchargeof; }

public:

manager();

manager(const string &fn, const string &ln,

const string &j, intico = 0);

manager(constabstr_emp&e, intico = 0);

manager(const manager &m);

virtual void ShowAll()const;

virtual void SetAll();

voidgetInCharge(){

cout<< "Enter inchargeof: ";

cin>>inchargeof;

}

class fink :virtual public abstr_emp

{

private:

stringreportsto;

protected:

const string ReportsTo()const{ return reportsto; }

string&ReportsTo(){ return reportsto; }

public:

fink();

fink(const string &fn, const string &ln,

const string &j, const string &rpo);

fink(constabstr_emp&e, const string &rpo);

fink(const fink &e);

virtual void ShowAll()const;

virtual void SetAll();

voidgetReportsTo(){

cout<< "Enter reportsto: ";

cin>>reportsto;

}

};

classhighfink :public manager, public fink

{

public:

highfink();

highfink(const string &fn, const string &ln,

const string &j, const string &rpo, intico = 0);

highfink(constabstr_emp&e, const string &rpo, intico = 0);

highfink(const fink &f, intico = 0);

highfink(const manager &m, const string &rpo);

highfink(consthighfink&h);

virtual void ShowAll()const;

virtual void SetAll();

};

#endif

//emp.cpp

#include "emp.h"

abstr_emp::abstr_emp() :fname("no one"), lname("no one"), job("no job") {

}

abstr_emp::abstr_emp(const string &fn, const string &ln, const string &j) : fname(fn), lname(ln), job(j)

{

}

voidabstr_emp::ShowAll()const

{

cout<< "Firstname: " <

cout<< "Lastname: " <

cout<< "Job is: " << job <

}

voidabstr_emp::SetAll()

{

cout<< "Enter firstname: ";

getline(cin, fname);

cout<< "Enter lastname: ";

getline(cin, lname);

cout<< "Enter position: ";

getline(cin, job);

}

ostream&operator<<(ostream&os, constabstr_emp&e) {

os<

returnos;

}

abstr_emp::~abstr_emp()

{

}

employee::employee() :abstr_emp()

{

}

employee::employee(const string &fn, const string &ln, const string &j) : abstr_emp(fn, ln, j)

{

}

void employee::ShowAll()const

abstr_emp::ShowAll();

}

void employee::SetAll()

{

abstr_emp::SetAll();

}

manager::manager() :abstr_emp()

{

}

manager::manager(const string &fn, const string &ln,

const string &j, intico) : abstr_emp(fn, ln, j), inchargeof(ico)

{

}

manager::manager(constabstr_emp&e, intico) : abstr_emp(e), inchargeof(ico) {

}

manager::manager(const manager &m) : abstr_emp(m)

{

}

void manager::ShowAll()const

{

abstr_emp::ShowAll();

cout<< "Inchargeof: " <

}

void manager::SetAll()

{

abstr_emp::SetAll();

cout<< "Enter inchargeof: ";

(cin>>inchargeof).get();

}

fink::fink() :abstr_emp()

{

}

fink::fink(const string &fn, const string &ln,

大学物理课本答案习题 第十三章习题解答

习题十三 13-1 如题图13-1所示,两条平行长直导线和一个矩形导线框共面,且导线框的一个边与长直导线平行,到两长直导线的距离分别为1r , 2r 。已知两导线中电流都为0sin I I t ω=,其中I 0和ω为常数,t 为 时间。导线框长为a ,宽为b ,求导线框中的感应电动势。 解:无限长直电流激发的磁感应强度为02I B r μ= π。取坐标Ox 垂直于 直导线,坐标原点取在矩形导线框的左边框上,坐标正方向为水平向右。取回路的绕行正方向为顺时针。由场强的叠加原理可得x 处的磁感应强度大小 00122() 2() I I B r x r x μμ= + π+π+ 方向垂直纸面向里。 通过微分面积d d S a x =的磁通量为 00m 12d d d d 2()2()I I B S B S a x r x r x μμΦππ?? =?==+??++?? 通过矩形线圈的磁通量为 00m 01 2d 2()2()b I I a x r x r x μμΦ??=+??π+π+???012012ln ln sin 2a r b r b I t r r μω?? ++=+ ?π?? 感生电动势 0m 12012d ln ln cos d 2i a r b r b I t t r r μωΦεω?? ++=- =-+ ?π?? 012012()()ln cos 2a r b r b I t r r μωω?? ++=- ??π?? 0i ε>时,回路中感应电动势的实际方向为顺时针;0i ε<时,回路中感应电动势的实际方向 为逆时针。 13-2 如题图13-2所示,有一半径为r =10cm 的多匝圆形线圈,匝数N =100,置于均匀磁场B 中(B =0.5T )。圆形线圈可绕通过圆心的轴O 1O 2转动,转速1 600r min n -=? 。求圆线圈自图示的初始位置转过 题图13-1 题图 13-2 解图13-1

c++primerplus中文版第六版源代码

C++ primer plus 中文版第六版源代码 第二章到第四章,后续继续更新……… 第二章 1:#include void main() { using namespace std; int carrots; carrots=25; cout<<"I have "; cout<

2:#include int stonetolb(int); int main() { using namespace std; int stone; cout<<"Enter the weight in stone: "; cin>>stone; int pounds=stonetolb(stone); cout< void main()

{ using namespace std; int carrots; carrots=25; cout<<"How many carrots do you have?"<>carrots; cout<<"Here are two more."; carrots=carrots+2; cout<<"Now you have "< using namespace std; void main() { cout<<"Come up and C++ me some time.";

大学物理学下册答案第11章

第11章 稳恒磁场 习 题 一 选择题 11-1 边长为l 的正方形线圈,分别用图11-1中所示的两种方式通以电流I (其中ab 、cd 与正方形共面),在这两种情况下,线圈在其中心产生的磁感应强度的大小分别为:[ ] (A )10B =,20B = (B )10B = ,02I B l π= (C )01I B l π= ,20B = (D )01I B l π= ,02I B l π= 答案:C 解析:有限长直导线在空间激发的磁感应强度大小为012(cos cos )4I B d μθθπ= -,并结合右手螺旋定则判断磁感应强度方向,按照磁场的叠加原理,可计 算 01I B l π= ,20B =。故正确答案为(C )。 11-2 两个载有相等电流I 的半径为R 的圆线圈一个处于水平位置,一个处于竖直位置,两个线圈的圆心重合,如图11-2所示,则在圆心O 处的磁感应强度大小为多少? [ ] (A )0 (B )R I 2/0μ (C )R I 2/20μ (D )R I /0μ 答案:C 解析:圆线圈在圆心处的磁感应强度大小为120/2B B I R μ==,按照右手螺旋定 习题11-1图 习题11-2图

则判断知1B 和2B 的方向相互垂直,依照磁场的矢量叠加原理,计算可得圆心O 处的磁感应强度大小为0/2B I R =。 11-3 如图11-3所示,在均匀磁场B 中,有一个半径为R 的半球面S ,S 边线所在平面的单位法线矢量n 与磁感应强度B 的夹角为α,则通过该半球面的磁通量的大小为[ ] (A )B R 2π (B )B R 22π (C )2cos R B πα (D )2sin R B πα 答案:C 解析:通过半球面的磁感应线线必通过底面,因此2cos m B S R B παΦ=?= 。故正 确答案为(C )。 11-4 如图11-4所示,在无限长载流直导线附近作一球形闭合曲面S ,当曲面S 向长直导线靠近时,穿过曲面S 的磁通量Φ B 将如何变化?[ ] ( A )Φ增大, B 也增大 (B )Φ不变,B 也不变 ( C )Φ增大,B 不变 ( D )Φ不变,B 增大 答案:D 解析:根据磁场的高斯定理0S BdS Φ==? ,通过闭合曲面S 的磁感应强度始终为0,保持不变。无限长载流直导线在空间中激发的磁感应强度大小为02I B d μπ= ,曲面S 靠近长直导线时,距离d 减小,从而B 增大。故正确答案为(D )。 11-5下列说法正确的是[ ] (A) 闭合回路上各点磁感应强度都为零时,回路内一定没有电流穿过 (B) 闭合回路上各点磁感应强度都为零时,回路内穿过电流的代数和必定为零 (C) 磁感应强度沿闭合回路的积分为零时,回路上各点的磁感应强度必定为零 (D) 磁感应强度沿闭合回路的积分不为零时,回路上任意一点的磁感应强度 I 习题11-4图 习题11-3图

C Primer Plus第6版编程练习答案

Chapter 2 Programming Exercises PE 2--‐1 /* Programming Exercise 2-1 */ #include <> int main(void) { printf("Gustav Mahler\n"); printf("Gustav\nMahler\n"); printf("Gustav "); printf("Mahler\n"); return 0; } PE 2--‐3 /* Programming Exercise 2-3 */ #include <> int main(void) { int ageyears; /* age in years */ int agedays; /* age in days */ /* large ages may require the long type */ ageyears = 101; agedays = 365 * ageyears; printf("An age of %d years is %d days.\n", ageyears, agedays); return 0; } PE 2--‐4 /* Programming Exercise 2-4 */ #include <> void jolly(void); void deny(void); int main(void) { jolly(); jolly(); jolly(); deny(); return 0; } void jolly(void) { printf("For he's a jolly good fellow!\n"); } void deny(void) { printf("Which nobody can deny!\n"); } PE 2--‐6 /* Programming Exercise 2-6 */ #include <> int main(void) { int toes; toes = 10; printf("toes = %d\n", toes);

内蒙古科技大学马文蔚大学物理(下册)第六版答案解析

第九章振动 习题:P37~39 1,2,3,4,5,6,7,8,16.

9-4 一质点做简谐运动,周期为T,当它由平衡位置向X 轴正方向运动时,从1/2 最大位移处到最大位移处这段路程所需的时间( ) A、T/12 B、T/8 C、T/6 D、T/4 分析(C),通过相位差和时间差的关系计算。可设位移函数 y=A*sin(ωt),其中ω=2π/T; 当y=A/2, ω t1= π /6 ;当y=A, ω t2= π /2 ;△ t=t2-t1=[ π /(2 ω )]-[ π /(6 ω )]= π/(3ω)=T/6

9-回图(a)中所阿的是两个简谐运动的曲线,若这两个简谐j?动可叠加* 则合成的余弦振动的初相位为() 3 1 (A)-7W (B)—IT(C)F (D)O 分析与解由振动曲线可以知道,这是两个同振动方向、同频率简谐运动, 它们的相位差是TT(即反相位)?运动方程分别为X I= Acos ωt利%2= -^-CoS(((;? + 瓷)?它们的振幅不同.对于这样两个简谐运动M用旋转欠量送,如图(b)很方便 A 求得合运动方程为x=ycos ωt.因而正确答案为(D). 9-目有一个弹簧振子,振幅4 =2-0 X 10-2 m,周期T = 1.0 s,初相<p = 3ιτ∕4.试写出它的运动方程,并作出X - 1图I e - i图和a - t图. 解因3=X∕T,则运动方程 / 2πf ≡?cos(ωt + φ) =ACUS

根据题中给出的数据得 X = 2. 0 Xio '2cos( 2irf + O- 75τr) ( m ) 振子的速度和加速度分别为 t) = dx∕(It = -4π × 10^2Rin(2ττt + 0. 75ττ) (m * s^,) (Z = ?2χ∕df2 = - 8TT2X 10 ^2cos( 2τrt + 0. 75τT) ( m ? s ^2) X-I^V-C及Oft图如图所示.

C Primer Plus (第六版)中文版 6.16编程练习

//******************6.15复习题************************** //*********** 6 ************************** #include int main(void) { int i, j; for (i = 0; i < 4; i++) //外层循环控制行内层循环控制列 { for (j = 0; j < 8; j++) { printf("$"); } printf("\n"); } return 0; } //******************6.16 编程练习 ************************** //****************** 一 ************************** #include #define SIZE 26 int main(void) { char array[SIZE]; int index = 0; array[0] = 'a'; printf("%c", array[0]); for (index = 1; index < SIZE; index++) { array[index] = 'a' + index; printf("%c", array[index]); } return 0; } //****************** 二 ************************** #include int main(void)

{ int i, j;//i控制行,j控制列计数作用 for (i = 0; i < 5; i++) { for (j = 0; j < =i ; j++) { printf("$"); } printf("\n"); } return 0; } //****************** 三 ************************** #include int main(void) { int i;//外层循环控制行 int j;//内层循环控制列 char ch = 'F'; for (i = 0; i < 6; i++) { for (j = 0; j <= i; j++) printf("%c", ch-j ); printf("\n"); } return 0; } //****************** 四 ************************** #include int main(void) { int i;//外层循环控制行 int j;//内层循环控制列 char ch = 'A'; for (i = 0; i < 6; i++) { for (j = 0; j <= i; j++) printf("%c", ch++ ); printf("\n");

CPrimerPlus第6版中文版勘误表

注意:下面的勘误中,红色字体为修改后的文字,提请各位读者注意。 第 6 页,” 1.6 语言标准”中的第 3 行,将 1987 年修改为 1978 年。 第 22 页,” 2. main ()函数”中的第 1 行, int main (void ) 后面的分号( ; )删除。 第 24 页,“5. 声明”的第 10 行,也就 是一个变量、函数或其他实体的名称。 第 27 页,图 2.3 中,下划线应该只包含括号中的内容;第 2 段的第 4 行,而不是存储 在 源代码 中的指令。 第 30页,“2.5.4 打印多个值”的第 4行,双引 号后面的第 1 个变量。 第 34页,“2.7.3 程序状态”第 2段的第 4 行,要尽量忠实 于代码来模拟。 第 35页,“2.10 本章小结”第 2段的第 1句,声明 语句为变量指定变量名, 并标识该变量中存 储的数据类型;本页倒数第 2 行,即 检查程序每执行一步后所有变量的值。 第37页,“2.12编程练习”中第1题,把你的名和姓打印在一行……把你的 名和姓分别打印在 两行……把你的 名和姓打印在一行……把示例的内容换成你的 名字。 第 40 页,第 1 行,用于把英 磅常衡盎司转换为… … 第44页,“3.4 C 语言基本数据类型”的第 1句,本节将 详细介绍C 语言的基本属性类型…… 第 46页,“5. 八进制和十六进制”的第 4句,十六进制数 3的二进制数 是 0011,十六进制数 5 的二进制数 是 0101;“6. 显示八进制和十六进制”的第 1 句,既可以使用 也可以 显示不同进制 的数;将“回忆一下……程序在执行完毕后不会立即关闭执行窗口”放到一个括号里。 第 47页,“2. 使用多种整数类型的原因”第 3句,过去的一台运行 Windows 3.x 的机器上。 第 53 页,图 3.5 下面的第 4 行“上面最后一个例子( printf ( “ ” a \\ is a backslash. ” \n ” ); )” 第 56页,正文的第 2行和第 4行应该分别为 printf ( “me32 = %““d”“\n ”, me32); printf ( “me32 = %d\n ” , me32); 第 61 页,“无符号类型”的最后 1 句,相当于 unsigned int (即两者之间添加一个空格 )。 第 62 页,程序清单 3.8 中的第 1 行,将 //* typesize.c -- 打印类型大小 */ 中的第一个斜杠删 除。 第 63页,“3.6 参数和陷阱”第 2行, printf ( “ Hello,pal. ” )(即 Hello, 和 pal. 之间没有空 格)。 第 64 页,程序清单 3.10 中的第 1 行,使用 转义序列。 第 75 页,倒数第 8行, 何时使用圆括号 取决于运算对象是类型还是特定量。 第82页,第11行, . 格式字符串包含了两个待打印项 number 和pies 对应的 ..... 第83页,表4.4中的“ L”修饰符的含义介绍中,应该是示例: ” %L ”、“%10.4Le” 第 84 页,表 4.5 中的第 1 行,即,从字段的左侧开始打印该 项(即,应该只保留一个 项);在 “ 0”标记的含义中,添加一行: 示例:"%010d"和"%08.3f"。 第86页,第1段的第2行,……字段宽度是容纳 待打印数字所需的……; 倒数第4段中,根据%x 打印出1f,根据%打印出1F 第87页,“4.4.4转换说明的意义”第 2段,……读者认为原始值 被替换成转换后的值。 第89页,“参数传递”第2行,把变量n1、n2、n3和n4的值传递给程序(即,保留一个顿号)。 第 93页,第 5行的 2121.45 的字体应该与第 4行的 42 的字体保持一致;表 4.6 上面的最后一 行,对于 double 类型要使用 1 修饰符。 第 94 页,表中的第 3 行,把对应的数值存储为 unsigned short int 类型;把“ j ”转换说明的 示例 放到“ z ”转换说明中;在“ j ”转换说明的含义中添加:示例:” %jd”、” %ju”。 第95页,“3.scanf () 的返回值”上面一段的倒数第 3行,如果在格式字符串中把空格放到 %c 的前面 。 第98页,倒数第2段,strlen () 函数(声明在string.h 头文件中)可用于 ... 。 第 100 页,” 4.8 编程练习”中的第 2 题,将该题中的“名和姓”统一替换为“名字” ;并执行 以下 操作;第 3题,将 a 、 b 项中的“输入”替换为” The input is ”,将“或”替换为“ or”, 将末尾1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30.

大学物理(上册)参考答案

第一章作业题 P21 1.1; 1.2; 1.4; 1.9 质点沿x 轴运动,其加速度和位置的关系为 a =2+62 x ,a 的单位为2 s m -?,x 的单 位为 m. 质点在x =0处,速度为101 s m -?,试求质点在任何坐标处的速度值. 解: ∵ x v v t x x v t v a d d d d d d d d === 分离变量: x x adx d )62(d 2 +==υυ 两边积分得 c x x v ++=32 2221 由题知,0=x 时,100 =v ,∴50=c ∴ 1 3s m 252-?++=x x v 1.10已知一质点作直线运动,其加速度为 a =4+3t 2 s m -?,开始运动时,x =5 m , v =0, 求该质点在t =10s 时的速度和位置. 解:∵ t t v a 34d d +== 分离变量,得 t t v d )34(d += 积分,得 1 223 4c t t v ++= 由题知,0=t ,00 =v ,∴01=c 故 2234t t v + = 又因为 2 234d d t t t x v +== 分离变量, t t t x d )23 4(d 2+= 积分得 2 3221 2c t t x ++= 由题知 0=t ,50 =x ,∴52=c 故 52123 2++ =t t x 所以s 10=t 时 m 70551021 102s m 1901023 10432101210=+?+?=?=?+ ?=-x v 1.11 一质点沿半径为1 m 的圆周运动,运动方程为 θ=2+33 t ,θ式中以弧度计,t 以秒

C Primer Plus第6版中文版勘误表教学提纲

C P r i m e r P l u s第6版中文版勘误表

注意:下面的勘误中,红色字体为修改后的文字,提请各位读者注意。 1.第6页,” 1.6语言标准”中的第3行,将1987年修改为1978年。 2.第22页,” 2. main()函数”中的第1行,int main (void)后面的分号(;)删除。 3.第24页,“5. 声明”的第10行,也就是一个变量、函数或其他实体的名称。 4.第27页,图2.3中,下划线应该只包含括号中的内容;第2段的第4行,而不是存储在源代 码中的指令。 5.第30页,“2.5.4 打印多个值”的第4行,双引号后面的第1个变量。 6.第34页,“2. 7.3 程序状态”第2段的第4行,要尽量忠实于代码来模拟。 7.第35页,“2.10 本章小结”第2段的第1句,声明语句为变量指定变量名,并标识该变量中存 储的数据类型;本页倒数第2行,即检查程序每执行一步后所有变量的值。 8.第37页,“2.12 编程练习”中第1题,把你的名和姓打印在一行……把你的名和姓分别打印在 两行……把你的名和姓打印在一行……把示例的内容换成你的名字。 9.第40页,第1行,用于把英磅常衡盎司转换为…… 10.第44页,“3.4 C语言基本数据类型”的第1句,本节将详细介绍C语言的基本属性类型…… 11.第46页,“5. 八进制和十六进制”的第4句,十六进制数3的二进制数是0011,十六进制数5 的二进制数是0101;“6.显示八进制和十六进制”的第1句,既可以使用也可以显示不同进制的数;将“回忆一下……程序在执行完毕后不会立即关闭执行窗口”放到一个括号里。 12.第47页,“2.使用多种整数类型的原因”第3句,过去的一台运行Windows 3.x的机器上。 13.第53页,图 3.5下面的第4行“上面最后一个例子(printf(“Gramps sez, \”a \\ is a backslash.\”\n”);)” 14.第56页,正文的第2行和第4行应该分别为printf(“me32= %“ “d” “\n”, me32); printf(“me32 = %d\n”, me32); 15.第61页,“无符号类型”的最后1句,相当于unsigned int(即两者之间添加一个空格)。 16.第62页,程序清单3.8中的第1行,将//* typesize.c -- 打印类型大小*/中的第一个斜杠删除。 17.第63页,“3.6参数和陷阱”第2行,printf(“Hello,pal.”)(即Hello,和pal.之间没有空格)。 18.第64页,程序清单3.10中的第1行,使用转义序列。 19.第75页,倒数第8行,何时使用圆括号取决于运算对象是类型还是特定量。 20.第82页,第11行,……格式字符串包含了两个待打印项number和pies对应的…… 21.第83页,表4.4中的“L”修饰符的含义介绍中,应该是示例:”%L f”、“%10.4L e” 22.第84页,表4.5中的第1行,即,从字段的左侧开始打印该项(即,应该只保留一个项); 在“0”标记的含义中,添加一行:示例:"%010d"和"%08.3f"。 23.第86页,第1段的第2行,……字段宽度是容纳待打印数字所需的……;倒数第4段中,根 据%x打印出1f,根据%X打印出1F 24.第87页,“4.4.4转换说明的意义”第2段,……读者认为原始值被替换成转换后的值。 25.第89页,“参数传递”第2行,把变量n1、n2、n3和n4的值传递给程序(即,保留一个顿 号)。 26.第93页,第5行的2121.45的字体应该与第4行的42的字体保持一致;表4.6上面的最后一 行,对于double类型要使用1修饰符。 27.第94页,表中的第3行,把对应的数值存储为unsigned short int类型;把“j”转换说明的示例 放到“z”转换说明中;在“j”转换说明的含义中添加:示例:”%jd”、”%ju”。

大学物理学(第五版)上册(马文蔚)课后答案及解析.

1-1 分析与解(1) 质点在t 至(t +Δt)时间内沿曲线从P 点运动到P′点,各量关系如图所示, 其中路程Δs =PP′, 位移大小|Δr|=PP′,而Δr =|r|-|r|表示质点位矢大小的变化量,三个量的物理含义不同,在曲线运动中大小也不相等(注:在直线运动中有相等的可能).但当Δt→0 时,点P′无限趋近P点,则有|dr|=ds,但却不等于dr.故选(B). (2) 由于|Δr |≠Δs,故,即||≠ . 但由于|dr|=ds,故,即||=.由此可见,应选(C). 1-2 分析与解表示质点到坐标原点的距离随时间的变化率,在极坐标系中叫径向速率.通常用符号vr表示,这是速度矢量在位矢方向上的一个分量;表示速度矢量;在自然坐标系中速度大小可用公式计算,在直角坐标系中则可由公式求解.故选(D). 1-3 分析与解表示切向加速度at,它表示速度大小随时间的变化率,是加速度矢量沿速度方向的一个分量,起改变速度大小的作用;在极坐标系中表示径向速率vr(如题1 -2 所述);在自然坐标系中表示质点的速率v;而表示加速度的大小而不是切向加速度at.因此只有(3) 式表达是正确的.故选(D). 1-4 分析与解加速度的切向分量at起改变速度大小的作用,而法向分量an起改变速度方向的作用.质点作圆周运动时,由于速度方向不断改变,相应法向加速度的方向也在不断改变,因而法向加速度是一定改变的.至于at是否改变,则要视质点的速率情况而定.质点作匀速率圆周运动时, at恒为零;质点作匀变速率圆周运动时, at为一不为零的恒量,当at改变时,质点则作一般的变速率圆周运动.由此可见,应选(B). 1-5 分析与解本题关键是先求得小船速度表达式,进而判断运动性质.为此建立如图所示坐标系,设定滑轮距水面高度为h,t 时刻定滑轮距小船的绳长为l,则小船的运动方程为,其中绳长l 随时间t 而变化.小船速度,式中表示绳长l 随时间的变化率,其大小即为v0,代入整理后为,方向沿x 轴负向.由速度表达式,可判断小船作变加速运动.故选(C). 1-6 分析位移和路程是两个完全不同的概念.只有当质点作直线运动且运动方向不改变时,位移的大小才会与路程相等.质点在t 时间内的位移Δx 的大小可直接由运动方程得到:,而在求路程时,就必须注意到质点在运动过程中可能改变运动方向,此时,位移的大小和路程就不同了.为此,需根据来确定其运动方向改变的时刻tp ,求出0~tp 和tp~t 内的位移大小Δx1 、Δx2 ,则t 时间内的路程,如图所示,至于t =4.0 s 时质点速度和加速度可用和两式计算. 解(1) 质点在4.0 s内位移的大小 (2) 由得知质点的换向时刻为(t=0不合题意) 则, 所以,质点在4.0 s时间间隔内的路程为 (3) t=4.0 s时, , 1-7 分析根据加速度的定义可知,在直线运动中v-t曲线的斜率为加速度的大小(图中AB、CD 段斜率为定值,即匀变速直线运动;而线段BC 的斜率为0,加速度为零,即匀速直线运动).加速度为恒量,在a-t 图上是平行于t 轴的直线,由v-t 图中求出各段的斜率,即可作出a-t 图线.又由速度的定义可知,x-t 曲线的斜率为速度的大小.因此,匀速直线运动所对应的x -t 图应是一直线,而匀变速直线运动所对应的x–t 图为t 的二次曲线.根据各段时间内的运动方程x=x(t),求出不同时刻t 的位置x,采用描数据点的方法,可作出x-t 图. 解将曲线分为AB、BC、CD 三个过程,它们对应的加速度值分别为 (匀加速直线运动), (匀速直线运动) (匀减速直线运动) 根据上述结果即可作出质点的a-t 图[图(B)]. 在匀变速直线运动中,有

大学物理学(第三版)赵近芳 第6章答案

习题六 6-1 气体在平衡态时有何特征?气体的平衡态与力学中的平衡态有何不同? 答:气体在平衡态时,系统与外界在宏观上无能量和物质的交换;系统的宏观性质不随时间变化. 力学平衡态与热力学平衡态不同.当系统处于热平衡态时,组成系统的大量粒子仍在不停地、无规则地运动着,大量粒子运动的平均效果不变,这是一种动态平衡.而个别粒子所受合外力可以不为零.而力学平衡态时,物体保持静止或匀速直线运动,所受合外力为零. 6-2 气体动理论的研究对象是什么?理想气体的宏观模型和微观模型各如何? 答:气体动理论的研究对象是大量微观粒子组成的系统.是从物质的微观结构和分子运动论出发,运用力学规律,通过统计平均的办法,求出热运动的宏观结果,再由实验确认的方法. 从宏观看,在温度不太低,压强不大时,实际气体都可近似地当作理想气体来处理,压强越低,温度越高,这种近似的准确度越高.理想气体的微观模型是把分子看成弹性的自由运动的质点. 6-3 何谓微观量?何谓宏观量?它们之间有什么联系? 答:用来描述个别微观粒子特征的物理量称为微观量.如微观粒子(原子、分子等)的大小、质量、速度、能量等.描述大量微观粒子(分子或原子)的集体的物理量叫宏观量,如实验中观测得到的气体体积、压强、温度、热容量等都是宏观量. 气体宏观量是微观量统计平均的结果. 2 8642150 24083062041021++++?+?+?+?+?= = ∑∑i i i N V N V 7.2141890== 1s m -? 方均根速率 2 8642150240810620410212 23222 2 ++++?+?+?+?+?= =∑∑i i i N V N V 6.25= 1s m -? 6-5 速率分布函数)(v f 的物理意义是什么?试说明下列各量的物理意义(n 为分子数密度, N 为系统总分子数).

c++ primer plus(第六版)第二至第六章课后编程练习全部答案

第二章:开始学习C++ //ex2.1--display your name and address #include int main(void) { using namespace std; cout<<"My name is liao chunguang and I live in hunan chenzhou.\n”;} //ex2.2--convert the furlong units to yard uints-把浪单位换位码单位 #include double fur2yd(double); int main() { using namespace std; cout<<"enter the distance measured by furlong units:"; double fur; cin>>fur; cout<<"convert the furlong to yard"< void mice(); void see(); using namespace std; int main() { mice(); mice(); see(); see(); return 0; }

大学物理学(第三版上) 课后习题6答案详解

习题6 6.1选择题 (1)一平面简谐波在弹性媒质中传播,在媒质质元从平衡位置运动到最大位移处的过程中: (A)它的动能转化为势能. (B)它的势能转化为动能. (C)它从相邻的一段质元获得能量其能量逐渐增大. (D)它把自己的能量传给相邻的一段质元,其能量逐渐减小. [答案:D ] (2) 某时刻驻波波形曲线如图所示,则a,b 两点位相差是 (A)π (B)π/2 (C)5π/4 (D)0 [答案:A] (3) 设声波在媒质中的传播速度为u,声源的频率为v s .若声源S不动,而接收器R相对于媒质以速度V B 沿着S、R连线向着声源S运动,则位于S、R连线中点的质点P的振动频率为 (A)s v (B) s B v u V u + (C) s B v V u u + (D) s B v V u u - [答案:A] 6.2填空题 (1)频率为100Hz ,传播速度为300m/s 的平面简谐波,波线上两点振动的相位差为π/3,则此两点相距____m 。 [答案:0.5m ] (2)一横波的波动方程是))(4.0100(2sin 02.0SI x t y -=π,则振幅是____,波长是____,频率是____,波的传播速度是____。 [答案:0.02;2.5;100;250/m m Hz m s ]

(3) 设入射波的表达式为])(2cos[1πλ νπ++ =x t A y ,波在x =0处反射,反 射点为一固定端,则反射波的表达式为________________,驻波的表达式为____________________,入射波和反射波合成的驻波的波腹所在处的坐标为____________________。 [答案:)(2cos 2λ νπx t A y - = ; 2cos(2)cos(2)22 x A t ππ π πνλ++ (21) 4 x k λ =-] 6.3产生机械波的条件是什么?两列波叠加产生干涉现象必须满足什么条件?满足什么条件的两列波才能叠加后形成驻波?在什么情况下会出现半波损失? 答:产生机械波必须具备两个条件:有作机械振动的物体即波源;有连续的介质。 两列波叠加产生干涉现象必须满足三个相干条件:频率相同,振动方向相同,在相遇点的位相差恒定。 两列波叠加后形成驻波的条件除频率相同、振动方向相同、在相遇点的位相差恒定三个相干条件外,还要求两列波振幅相同,在同一直线上沿相反方向传播。 出现半波损失的条件是:波从波疏媒质入射并被波密媒质反射,对于机械波,还必须是正入射。 6.4波长、波速、周期和频率这四个物理量中,哪些量由传播介质决定?哪些量由波源决定? 答:波速由传播介质决定;周期和频率由波源决定。 6.5波速和介质质元的振动速度相同吗?它们各表示什么意思?波的能量是以什么速度传播的? 答:波速和介质质元的振动速度不相同。波速是振动状态在介质中的传播速度,而质元的振动速度是质元在其平衡位置附近运动的速度。波的能量传播的速度即为波速。 6.6振动和波动有什么区别和联系?平面简谐波波动方程和简谐振动方程有什么不同?又有什么联系?振动曲线和波形曲线有什么不同?行波和驻波有何区别? 答: (a)振动是指一个孤立的系统(也可是介质中的一个质元)在某固定平衡位置附近所做的往复运动,系统离开平衡位置的位移是时间的周期性函数,即可表示为 )(t f y =;波动是振动在连续介质中的传播过程,此时介质中所有质元都在各自的 平衡位置附近作振动,因此介质中任一质元离开平衡位置的位移既是坐标位置x ,又是时间t 的函数,即),(t x f y =. (b)在谐振动方程)(t f y =中只有一个独立的变量时间t ,它描述的是介质中一个质

cprimerplus第六版课后编程练习答案

第二章:开始学习C++ n”; } < intmain() { usingnamespacestd; cout<<"Entertheautomobilegasolineconsumptionfigurein\n" <<""; doubleUS_style; cin>>US_style; cout<<"ConvertstoEuropeanstyle(milespergallon):"<

snack[0].calory=200; snack[1].brand="B"; snack[1].weight=; snack[1].calory=400; snack[2].brand="C"; snack[2].weight=; snack[2].calory=500; for(inti=0;i<3;i++) { cout<<"brand:"< intmain() { usingnamespacestd; constintSize=3; intsuccess[Size]; cout<<"Enteryoursuccessofthethreetimes40metersrunning:\n"; cin>>success[0]>>success[1]>>success[2]; cout<<"success1:"< #include intmain() { usingnamespacestd; arrayad={0}; cout<<"Enteryoursuccessofthethreetimes40metersrunning:\n"; cin>>ad[0]>>ad[1]>>ad[2]; cout<<"success1:"<

大学物理学(第三版上)课后习题6答案详解

习题 6 6.1 选择题 (1) 一平面简谐波在弹性媒质中传播,在媒质质元从平衡位置运动到最大位移 处的过程中: (A) 它的动能转化为势能 . (B) 它的势能转化为动能 . (C) 它从相邻的一段质元获得能量其能量逐渐增大 . (D) 它把自己的能量传给相邻的一段质元,其能量逐渐减小 . [ 答案: D] (2) 某时刻驻波波形曲线如图所示,则 a,b 两点位相差是 (A)π (C)5π/4 [ 答案: A] (3) 设声波在媒质中的传播速度为u,声源的频率为 v s .若声源S不动,而接 收器R相对于媒质以速度 V B 沿着S、R连线向着声源S运动,则位于S、 R连线中点的质点P的振动频率为 [ 答案: A] 6.2 填空题 (1) ______________________ 频率为 100Hz ,传播速度为 300m/s 的平面简谐波,波线上两点振动的相位 差为 π /3,则此两点相距 m 。 [答案: 0.5m ] (2)一横波的波动方程是 y 0.02sin2 (100t 0.4x)( SI ) ,则振幅是 ________ ,波 长是 ___ ,频率是 __ ,波的传播速度是 __ 。 [ 答案: 0.02m;2.5 m;100 Hz;250 m / s ] x (D)0 (A) v s (B) u V B u (C) v s u V B s (D) u u V B v s (B)π/2

(3) 设入射波的表达式为y1 Acos[2 ( t ) ] ,波在x =0处反射,反 射点为一固定端,则反射波的表达式为__________________ ,驻波的表达式为____________________ ,入射波和反射波合成的驻波的波腹所在处的坐标为 x [ 答案:y2 Acos2 ( t ) ; x 2 A cos(2 )cos(2 t ) 22 x (2k 1) ] 4 6.3 产生机械波的条件是什么?两列波叠加产生干涉现象必须满足什么条件?满足什么条件的两列波才能叠加后形成驻波?在什么情况下会出现半波损失?答:产生机械波必须具备两个条件:有作机械振动的物体即波源;有连续的介质。两列波叠加产生干涉现象必须满足三个相干条件:频率相同,振动方向相同,在相遇点的位相差恒定。 两列波叠加后形成驻波的条件除频率相同、振动方向相同、在相遇点的位相差恒定三个相干条件外,还要求两列波振幅相同,在同一直线上沿相反方向传播。 出现半波损失的条件是:波从波疏媒质入射并被波密媒质反射,对于机械波,还必须是正入射。 6.4 波长、波速、周期和频率这四个物理量中,哪些量由传播介质决定?哪些量由波源决定? 答:波速由传播介质决定;周期和频率由波源决定。 6.5 波速和介质质元的振动速度相同吗?它们各表示什么意思?波的能量是以什么速度传播的?答:波速和介质质元的振动速度不相同。波速是振动状态在介质中的传播速度,而质元的振动速度是质元在其平衡位置附近运动的速度。波的能量传播的速度即为波速。 6.6 振动和波动有什么区别和联系?平面简谐波波动方程和简谐振动方程有什么不同?又有什么联系?振动曲线和波形曲线有什么不同?行波和驻波有何区别?答: (a) 振动是指一个孤立的系统(也可是介质中的一个质元)在某固定平衡位置附近所做的往复运动,系统离开平衡位置的位移是时间的周期性函数,即可表示为y f (t) ;波动是振动在连续介质中的传播过程,此时介质中所有质元都在各自的平衡位置附近作振动,因此介质中任一质元离开平衡位置的位移既是坐标位置x ,又是时间t的函数,即y f (x,t). (b) 在谐振动方程y f (t) 中只有一个独立的变量时间t ,它描述的是介质中一个质

相关主题
文本预览
相关文档 最新文档