Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Group XXXXXXXXXX LA B #14 C reating a file, reading that file w ith eof() and processing. The task and additional guide to do it! A study of tw o H aw k populations, the count of The H arris H aw k(H...

1 answer below »

Group XXXXXXXXXX
LA
B
#14 C
eating a file, reading that file w
ith eof()
and processing. The task and additional guide to do it!
A study of tw
o H
aw
k populations, the count of The H
a
is
H
aw
k(H
) and the
H
aw
k(S
) collected per day
in S
adona, A
izona D
ata is below.
S
am
ple data
D
ay H
S

XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
8
XXXXXXXXXX
9
XXXXXXXXXX
1.
Have your program
Construct a data file w
ith sim
ilar data below

from
your group. U
se the tem
plate in last slide as
as w
ell as the Dem
onstration program
Ro
ins5_4, on
creating a new
file and sending data to it. Sim
ilar To the
eport files. Do this As follow
s, open file for output(creates
a new
file)using the class ofstream
and create a nam
e of
your choice(sim
ilar to fout).
2. E
nter the three data item
s to your created data file,day num
er, H

count, S count at the keyboard, save to file, use spaces betw
een
num
ers and endl;, B
e sure your code closes the file.
3. Then use getting data from
a file w
ith eof() function open the file
again to read w
ith the ifstream
object w
ith your nam
e of your choice(like
fin).
4. after your read the three values in the set it w
ill process the data
sim
ilarto the D
em
onstration to produce the follow
ing below
and create
and send the results to a report file.
S
ee next slide.
Lab #14 continued
5.The file should be intelligently w
orded w
ith the follow
ing inform
ation clearly enum
erated.
all of w
hich sim
ultaneously is echoed and sent to the screen (cout!) You copy and attach as
usual. S
end program
and the tw
o files used to m
e.
a.. The total num
er of records
. The average num
er of H
a
is H
aw
ks
c. The average num
er per day of
H
aw
k
d. The total num
er of all H
aw
ks
e. The average of all H
aw
ks per day
f The m
inim
um
num
er of H
a
is H
aw
ks and the day it occu
ed.
g The m
inim
um
num
er of
H
aw
k and the day it occu
ed
h The m
axim
um
num
er of H
a
is H
aw
ks and the day it occu
ed
i. The m
axim
um
num
er of
H
aw
k and the day it occu
ed
N
O
TE A M
IN
IM
U
M
and M
AXIM
U
M
D
AY AR
E AD
D
ED
TO
TH
IS G
R
O
U
P IN
C
O
N
STR
AST TO
TH
E
PR
EVIO
U
S PR
O
G
R
A
M
, B
E SU
R
E TO
IN
C
LU
D
E TH
EM
, SEE PR
EVIO
U
S PR
O
G
R
A
M
S FO
R

EXAM
PLES O
F TH
IS.
6 B
e sure to echo to the screen the contents of the report file and copy to the screen,
w
hich is copied to the program
, as usual.
7. H
and in I. program
file w
ith attached screen output,
II the program
created data file,
III. report file
C
ollect all files to send in the em
ail, your nam
e in all file nam
es!
B
e sure your N
am
e starts the file N
AM
E
in all of them
.

lab4
Abstract
*
LAB 4 HINAR HASSAN 03/08/2022
ABSTRACT : Given an Electrodynamic situation. Two charged plates,
separated by a
distance Y(meters), create an electric field, E which is measured as
the force
per unit charge(Newtons/Coulomb).A small positive charged particle,
Q(Coulombs)
is placed at the top plate and experiences a force, F(Newtons) which
creates an
acceleration, a(m/s^2) towards negative, it travels the full distance
Y.
The charge hits the negative plate at a velocity v, falling in a time
t..
Hitting with kinetic energy, K.
Equations governing the behavior are:
1. F=QE
2. a =F/m
3. y=1/2a(t^2)
4. v=at
5. K=1/2 m(v^2)
*
Includes section
#include #include #include #include using namespace std;
constants section
const double mass = 1.4e-6;
main
int main() {

Vairable declaration
string _distance(" meters"), _electric_field(" Newtons/Coulomb"),
_charge(" Coulomb"), _force(" Newton"), _acceleration(" m/s^2"),
_time(" seconds"), _velocity(" m/s"), _kinetic_energy(" kg m^2/
s^2");
double force, acceleration, time, velocity, kinetic_energy, charge,
electric_field, distance;

Explaination to the user.
cout
"\nDetermine the force experienced by a positively charged
\n"
"particle, which is placed on the top of the positively
charged \n"
"plate.It will then compute the acceleration. As the
distance \n"
"between the plates is fixed, it determines the time taken
y the \n"
"particle to reach the negatively charged plate. Then
computes the \n"
"velocity at which the particle collides. Finally, computes
the \n"
"kinetic energy with which it collides on the negatively
charged \n"
"plate.";

Input section
cout
"\n\nPlease provide charge in (coulomb): ";
cin
charge;
cout
"\nPlease provide electric field (in Newtons/ Coulomb): ";
cin
electric_field;
cout
"\nPlease provide the distance between the plates (in
meters): ";
cin
distance;

calculations section
force = charge * electric_field;
acceleration = force / mass;
time = sqrt((2 * distance) / acceleration);
velocity = acceleration * time;
kinetic_energy = 0.5 * (mass)*pow(velocity, 2);

output section
cout.precision(4);
cout
"\nForce experienced by the positively charged particle is :
"

scientific
force
_force;
cout
"\nAcceleration created is : "
scientific
acceleration

_acceleration;
cout
"\nTime taken by the particle to reach the negatively
charged plate "
"is : "

scientific
time
_time;
cout
"\nVelocity at which the particle travels is : "

scientific

velocity
_velocity;
cout
"\nKinetic Energy with which the particle collides is : "

scientific
kinetic_energy
_kinetic_energy;
cout
"\n";
return 0;
}
captured output
*
Determine the force experienced by a positively charged
particle, which is placed on the top of the positively charged
plate.It will then compute the acceleration. As the distance
etween the plates is fixed, it determines the time taken by the
particle to reach the negatively charged plate. Then computes the
velocity at which the particle collides. Finally, computes the
kinetic energy with which it collides on the negatively charged
plate.
Please provide charge in (coulomb): 4.1e-6
Please provide electric field (in Newtons/ Coulomb): 6.84e7
Please provide the distance between the plates (in meters): 1.4e-6
Force experienced by the positively charged particle is : 2.8044e+02
Newton
Acceleration created is : 2.0031e+08 m/s^2
Time taken by the particle to reach the negatively charged plate is :
1.1823e-07 seconds
Velocity at which the particle travels is : 2.3683e+01 m/s
Kinetic Energy with which the particle collides is : 3.9262e-04 kg
m^2/ s^2
*
*
Determine the force experienced by a positively charged
particle, which is placed on the top of the positively charged
plate.It will then compute the acceleration. As the distance
etween the plates is fixed, it determines the time taken by the
particle to reach the negatively charged plate. Then computes the
velocity at which the particle collides. Finally, computes the
kinetic energy with which it collides on the negatively charged
plate.
Please provide charge in (coulomb): 3.1e-6
Please provide electric field (in Newtons/ Coulomb): 5.84e7
Please provide the distance between the plates (in meters): 1.2e-6
Force experienced by the positively charged particle is : 1.8104e+02
Newton
Acceleration created is : 1.2931e+08 m/s^2
Time taken by the particle to reach the negatively charged plate is :
1.3623e-07 seconds
Velocity at which the particle travels is : 1.7617e+01 m/s
Kinetic Energy with which the particle collides is : 2.1725e-04 kg
m^2/ s^2 *
*
Determine the force experienced by a positively charged
particle, which is placed on the top of the positively charged
plate.It will then compute the acceleration. As the distance
etween the plates is fixed, it determines the time taken by the
particle to reach the negatively charged plate. Then computes the
velocity at which the particle collides. Finally, computes the
kinetic energy with which it collides on the negatively charged
plate.
Answered 1 days After Mar 29, 2022

Solution

Arun Shankar answered on Mar 30 2022
104 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here