Modify this code to use multiple threads with the same data1.Modif.pdfmallik3000
Modify this code to use multiple threads with the same data
1.Modify the main function to implement a loop that reads 10 integers from the console (user
input) and stores these numbers in a one-dimensional (1D) array (this code will go right after the
comment that says “Add code to perform any needed initialization or to process user input”).
You should use a global array for this.
2.Implement a separatepthread function function for each one of the following operations:
a.Count and print out how many of the entered numbers are negative. This function must be
named countNegatives
b.Calculate and print the average value of all the numbers entered. This function must be named
average
c.Print the numbers in reverse order from the order in which they were entered. This function
must be named reverse
3.Modify the main function to create one pthread for each one of the functions that you
implemented in (3) above (this code will go between the comment that says “TODO: Modify
according to assignment requirements” and the “if (rc)” check).
Compile your program and run it several times. If the output of your program is garbled, you
may need to add a small delay in between creating the next thread.
#include
#include
using namespace std;
void *routineName(void *arg)
{
// TODO: Add code that implements
// the thread\'s functionality
cout << \"Thread is running...\" << endl;
return 0;
}
int main()
{
pthread_t id;
int rc;
int ints;
for(int x; x<10; x++)
{
cout << \"Enter Integer: \" <>
}
rc = pthread_create(&id, NULL, routineName, NULL);
if (rc){
cout << \"ERROR; return code from pthread_create() is \" << rc << endl;
return -1;
}
pthread_exit(0);
}
Solution
#include
#include
#include
using namespace std;
int ints[10];
//Method to count negatives in the input array
void *countNegatives(void*){
int count = 0;
for(int i=0;i<10;i++){
if(ints[i]<0){
count++;
}
}
cout<<\"Number of negatives: \"<=0;i--){
cout<> ints[x];
}
//Creating pthread to countNegatives
rc = pthread_create(&t1, NULL, countNegatives, NULL);
if(rc){
cout << \"Error:unable to create thread,\" << rc << endl;
}
//Adding delay
sleep(1);
//Creating pthread to compute average
rc = pthread_create(&t2, NULL, average, NULL);
if(rc){
cout << \"Error:unable to create thread,\" << rc << endl;
}
//Adding delay
sleep(1);
//Creating pthread to print in reverse
rc = pthread_create(&t3, NULL, reverse, NULL);
if(rc){
cout << \"Error:unable to create thread,\" << rc << endl;
}
//Adding delay
sleep(1);
void* status;
//waiting for t1 to join
rc = pthread_join(t1,&status);
if(rc){
cout << \"Error:unable to join,\" << rc << endl;
}
//waiting for t2 to join
rc = pthread_join(t2,&status);
if(rc){
cout << \"Error:unable to join,\" << rc << endl;
}
//waiting for t3 to join
rc = pthread_join(t3,&status);
if(rc){
cout << \"Error:unable to join,\" << rc << endl;
}
pthread_exit(0);
}.
prog 5~$AD FOR WHAT TO DO.docxprog 5alerts.txt2009-09-13.docxwkyra78
prog 5/~$AD FOR WHAT TO DO.docx
prog 5/alerts.txt
2009-09-13T20:16,2009-09-13T21:15,26-145,SEVERE THUNDERSTORM WARNING
2009-10-02T10:10,2009-10-13T11:20,39-125,TORNADO WARNING
2009-02-03T06:40,2009-02-03T08:00,15-009,TSUNAMI WARNING
2009-11-15T12:00,2009-11-17T00:00,02-068,WINTER STORM WARNING
2009-09-13T20:10,2009-09-20T12:00,26-111,CHEMICAL EMERGENCY
1776-07-04T00:00,2009-12-31T00:00,11-001,EXCESSIVE GOVT SPENDING
2009-09-29T10:15,2009-10-01T09:00,27-077,FLOOD WARNING
2009-11-01T05:10,2009-11-04T17:00,12-011,HURRICANE WARNING
2009-03-13T10:10,2009-03-24T23:00,49-035,NUCLEAR MATERIAL RELEASE
2009-05-05T02:15,2009-05-07T09:00,02-150,VOLCANIC ASH WARNING
prog 5/READ FOR WHAT TO DO.docx
Purpose
This program will provide an opportunity to practice using multiple C++ classes and class composition.
Specifications
Write a program that will interpret weather and national emergency messages disseminated by the U.S. Government.
The government has created a dataset of "FIPS codes." Each county in the U.S. is assigned a unique five-digit code. This code is used to identify the county when warnings are generated. It is most used for weather warnings, but also could be used for industrial or national emergencies. For example, for Saginaw County, MI, the code is 26145.
You are provided with a data file containing all FIPS codes for each county in the nation (filename usfips.txt). An example line of data in the file would be:
MI,26,145,Saginaw
You are also provided with a file that contains a list of active warnings nationwide (filename alerts.txt). A typical warning message in this file would look like the following example:
2009-09-13T20:16,2009-09-13T21:15,26-145,SEVERE THUNDERSTORM WARNING
Output for this warning message should be something like:
SEVERE THUNDERSTORM WARNING for Saginaw County, MI
Effective: 13 SEP 09 at 8:16 p.m. until 13 SEP 09 at 9:15 p.m
Write your program such that it processes through all active warnings, decodes the data, and writes a warning message similar to the provided example for each alert.
Design your solution using an object-oriented approach. Create a class that will store and manage information for one county. This should include data members for FIPS code, county name, and state code. Include get/set functions for all data members as well as at least one constructor. Next, design a "manager" class that will include and manage a list of FIP code objects. This manager class will act as a "database" of FIP codes. Be sure it includes a function to return the county and state name given a valid FIP code.
Your program should be driven by a list of warning messages(found in file alerts.txt). Each line of data in this file represents a distinct warning message that is disseminated by an agency of the U.S. Government. So finally, create a class that will store one alert message. This will store relevant information about the alert including the FIPS code. Note that objects of the class must have access to a FIPS ...
Modify this code to use multiple threads with the same data1.Modif.pdfmallik3000
Modify this code to use multiple threads with the same data
1.Modify the main function to implement a loop that reads 10 integers from the console (user
input) and stores these numbers in a one-dimensional (1D) array (this code will go right after the
comment that says “Add code to perform any needed initialization or to process user input”).
You should use a global array for this.
2.Implement a separatepthread function function for each one of the following operations:
a.Count and print out how many of the entered numbers are negative. This function must be
named countNegatives
b.Calculate and print the average value of all the numbers entered. This function must be named
average
c.Print the numbers in reverse order from the order in which they were entered. This function
must be named reverse
3.Modify the main function to create one pthread for each one of the functions that you
implemented in (3) above (this code will go between the comment that says “TODO: Modify
according to assignment requirements” and the “if (rc)” check).
Compile your program and run it several times. If the output of your program is garbled, you
may need to add a small delay in between creating the next thread.
#include
#include
using namespace std;
void *routineName(void *arg)
{
// TODO: Add code that implements
// the thread\'s functionality
cout << \"Thread is running...\" << endl;
return 0;
}
int main()
{
pthread_t id;
int rc;
int ints;
for(int x; x<10; x++)
{
cout << \"Enter Integer: \" <>
}
rc = pthread_create(&id, NULL, routineName, NULL);
if (rc){
cout << \"ERROR; return code from pthread_create() is \" << rc << endl;
return -1;
}
pthread_exit(0);
}
Solution
#include
#include
#include
using namespace std;
int ints[10];
//Method to count negatives in the input array
void *countNegatives(void*){
int count = 0;
for(int i=0;i<10;i++){
if(ints[i]<0){
count++;
}
}
cout<<\"Number of negatives: \"<=0;i--){
cout<> ints[x];
}
//Creating pthread to countNegatives
rc = pthread_create(&t1, NULL, countNegatives, NULL);
if(rc){
cout << \"Error:unable to create thread,\" << rc << endl;
}
//Adding delay
sleep(1);
//Creating pthread to compute average
rc = pthread_create(&t2, NULL, average, NULL);
if(rc){
cout << \"Error:unable to create thread,\" << rc << endl;
}
//Adding delay
sleep(1);
//Creating pthread to print in reverse
rc = pthread_create(&t3, NULL, reverse, NULL);
if(rc){
cout << \"Error:unable to create thread,\" << rc << endl;
}
//Adding delay
sleep(1);
void* status;
//waiting for t1 to join
rc = pthread_join(t1,&status);
if(rc){
cout << \"Error:unable to join,\" << rc << endl;
}
//waiting for t2 to join
rc = pthread_join(t2,&status);
if(rc){
cout << \"Error:unable to join,\" << rc << endl;
}
//waiting for t3 to join
rc = pthread_join(t3,&status);
if(rc){
cout << \"Error:unable to join,\" << rc << endl;
}
pthread_exit(0);
}.
prog 5~$AD FOR WHAT TO DO.docxprog 5alerts.txt2009-09-13.docxwkyra78
prog 5/~$AD FOR WHAT TO DO.docx
prog 5/alerts.txt
2009-09-13T20:16,2009-09-13T21:15,26-145,SEVERE THUNDERSTORM WARNING
2009-10-02T10:10,2009-10-13T11:20,39-125,TORNADO WARNING
2009-02-03T06:40,2009-02-03T08:00,15-009,TSUNAMI WARNING
2009-11-15T12:00,2009-11-17T00:00,02-068,WINTER STORM WARNING
2009-09-13T20:10,2009-09-20T12:00,26-111,CHEMICAL EMERGENCY
1776-07-04T00:00,2009-12-31T00:00,11-001,EXCESSIVE GOVT SPENDING
2009-09-29T10:15,2009-10-01T09:00,27-077,FLOOD WARNING
2009-11-01T05:10,2009-11-04T17:00,12-011,HURRICANE WARNING
2009-03-13T10:10,2009-03-24T23:00,49-035,NUCLEAR MATERIAL RELEASE
2009-05-05T02:15,2009-05-07T09:00,02-150,VOLCANIC ASH WARNING
prog 5/READ FOR WHAT TO DO.docx
Purpose
This program will provide an opportunity to practice using multiple C++ classes and class composition.
Specifications
Write a program that will interpret weather and national emergency messages disseminated by the U.S. Government.
The government has created a dataset of "FIPS codes." Each county in the U.S. is assigned a unique five-digit code. This code is used to identify the county when warnings are generated. It is most used for weather warnings, but also could be used for industrial or national emergencies. For example, for Saginaw County, MI, the code is 26145.
You are provided with a data file containing all FIPS codes for each county in the nation (filename usfips.txt). An example line of data in the file would be:
MI,26,145,Saginaw
You are also provided with a file that contains a list of active warnings nationwide (filename alerts.txt). A typical warning message in this file would look like the following example:
2009-09-13T20:16,2009-09-13T21:15,26-145,SEVERE THUNDERSTORM WARNING
Output for this warning message should be something like:
SEVERE THUNDERSTORM WARNING for Saginaw County, MI
Effective: 13 SEP 09 at 8:16 p.m. until 13 SEP 09 at 9:15 p.m
Write your program such that it processes through all active warnings, decodes the data, and writes a warning message similar to the provided example for each alert.
Design your solution using an object-oriented approach. Create a class that will store and manage information for one county. This should include data members for FIPS code, county name, and state code. Include get/set functions for all data members as well as at least one constructor. Next, design a "manager" class that will include and manage a list of FIP code objects. This manager class will act as a "database" of FIP codes. Be sure it includes a function to return the county and state name given a valid FIP code.
Your program should be driven by a list of warning messages(found in file alerts.txt). Each line of data in this file represents a distinct warning message that is disseminated by an agency of the U.S. Government. So finally, create a class that will store one alert message. This will store relevant information about the alert including the FIPS code. Note that objects of the class must have access to a FIPS ...
(1) Learn to create class structure in C++(2) Create an array of.docxgertrudebellgrove
(1) Learn to create class structure in C++
(2) Create an array of objects in C++
(3) Search and perform operations on the array of objects
Project Description:
The input csv file for this project consists of rows of data that deals with COVID-19 cases and deaths per day for each county in every state in the United States. Here is an example,
date,county,state,fips,cases,deaths
2020-01-21,Snohomish,Washington,53061,1,0
2020-01-22,Snohomish,Washington,53061,1,0
2020-01-23,Snohomish,Washington,53061,1,0
For the purposes of this project, we will assume that the following are char* data types: date, county, and state. FIPS (unique identifier for each county) along with cases and deaths are int data types. Please note the comma delimiter in each row. You need to carefully read each field knowing that you will have a comma.
You will use redirected input (more later) to read an input txt file that contains the following:
counts //number of data entries in the csv file
Filename.csv //this is the file that contains the covid-19 data
Command //details of what constitutes a command is given below
Command
Command
….
Your C++ program will read the counts value on the first line of the txt file, which represents the number of data entries in the csv file. (Note - the first line of the csv file contains descriptive variable fields, so there will be a total of [number of data entries + 1] lines in the csv file). Then, on the second line, it will read the Filename.csv and open the file for reading (more on how to do this in C++). After you open the file, you will read the data from each row of the csv file and create a COVID19 object. The COVID19 class is given below. You need to implement all of the necessary methods.
class COVID19 {
protected:
char* date;
char* county;
char* state;
int fips;
int cases;
int deaths;
public:
COVID19 (); //default constructor
COVID19 (char* da, char* co, char* s, int f,
int ca, int de); //initializer
display ();
//write all accessors and other methods as necessary
};
After your write the above class you will write the following class:
class COVID19DataSet {
protected:
COVID19* allData;
int count; //number of COVID19 objects in allData
int size; //maximum size of array
public:
COVID19DataSet (); //default constructor
COVID19DataSet (int initSize);
void display ();
void addRow (COVID19& oneData);
int findTotalCasesByCounty (char* county, char* state);
int findTotalDeathsByCounty (char* county, char* state);
int findTotalCasesByState (char* state);
int findTotalDeathsByState (char* state);
int findTotalCasesBySateWithDateRange (char* state,
char* startDate, char* endDate);
int findTotalDeathsBySateWithDateRange (char* state,
char* startDate, char* endDate);
~COVID19(); //destructor
//other methods as deem important
};
The structure of the main program will be something like this:
#include
using namespace std;
// Write all the classes here
int main () {
int count.
This is my attempt at a look at some of the features of C++11, and more importantly, describing some of the style changes in C++11 that will make programmers more productive and programs more efficient.
write the To Dos to get the exact outputNOte A valid Fraction .pdfjyothimuppasani1
write the To Do\'s to get the exact output:
NOte: A valid Fraction number has a non-negative numerator and a positive denominator.
Default constructor initializes the object to safe empty state (an object with denom equals -1).
The two-argument constructor also validates the parameters and sets the object to the safe empty
state if the parameters are not valid.
Write the definitions and prototypes of following functions in Fraction.cpp and Fraction.h
respectively (They are indicated in the files by //TODO tag):
Define isEmpty function as a member function, which returns true if the object is in safe empty
state (an object is in the safe empty state if denominator (denom) equals -1).
Define display function, which sends a Fraction number to the output stream (with the
“Numerator/denominator” format). This function just prints \"Invalid Fraction Object!\" in the
screen if the object is in the safe empty state. In case that object denominator equals 1, it just
print the numerator.
Define the operator functions for the following operators:
“+=”, “+”, “*”
The overload of the above operators should make the following code possible:
The member operator+ : Adds two Fraction numbers and returns a Fraction number as the result.
This function returns an object with the safe empty state if either of Fraction numbers (operands)
is in safe empty state. It makes following code possible:
A+B ( where A and B are Fraction objects)
The member operator+= : Adds two Fraction numbers and assigns the result to the left operand,
then returns a reference to the left operand. If either of Fraction numbers (operands) is in safe
empty state, it initializes the left operand to the safe empty state, then returns a reference to the
left operand. It makes following code possible:
A+=B ( where A and B are Fraction objects)
The member operator* : Multiplies two Fraction numbers and returns a Fraction number as the
result. This function returns an object with the safe empty state if either of Fraction numbers
(operands) is in safe empty state. It makes following code possible:
A*B ( where A and B are Fraction objects)
fraction.cpp
#include \"Fraction.h\"
using namespace std;
namespace sict{
Fraction::Fraction(){
denom =-1; // safe empty state
}
Fraction::Fraction(int n, int d) // n: numerator, d: denominator
{
if(n >= 0 && d > 0){
num = n;
denom = d;
reduce();
}
else
denom =-1; // set to safe empty state
}
int Fraction::gcd() // returns the greatest common divisor of num and
denom
{
int mn = min(); // min of num and denom
int mx = max(); // mX of num and denom
for (int x=mn ; x > 0 ; x--) // find the greatest common divisor
if( mx % x == 0 && mn % x == 0)
return x;
return 1;
}
void Fraction::reduce() // simplify the Fraction number
{
int tmp = gcd();
num /= tmp;
denom /= tmp;
}
int Fraction::max ()
{
return (num >= denom) ? num : denom;
}
int Fraction::min()
{
return (num >= denom) ? denom : num;
}
// in_lab
// TODO: write the implementation of display function HERE
// TODO: w.
Demonstrate cultural awareness of the Aboriginal andor Torres Strai.pdfAggarwalelectronic18
Demonstrate cultural awareness of the Aboriginal and/or Torres Strait Islander local community
Students may research the local Aboriginal and/or Torres Strait Islander community resources
and prepare a presentation on various interesting aspects of their history, land, language, and
communication- mannerisms, common Aboriginal and/or Torres Strait Islander words.
Please include Reference thank you.
Deposit insuranceGroup of answer choicesleads depositors to be .pdfAggarwalelectronic18
Deposit insurance:
Group of answer choices
leads depositors to be less inclined to monitor bank operations.
often makes banks more accountable for their actions and less likely to engage in risky behavior.
essentially serves the same function as a fractional reserve system.
can increase the possibility of bank runs Deposit insurance: leads depositors to be less inclined to
monitor bank operations. often makes banks more accountable for their actions and less likely to
engage in risky behavior. essentially serves the same function as a fractional reserve system. can
increase the possibility of bank runs.
More Related Content
Similar to CountryData.cppEDIT THIS ONE#include fstream #include str.pdf
(1) Learn to create class structure in C++(2) Create an array of.docxgertrudebellgrove
(1) Learn to create class structure in C++
(2) Create an array of objects in C++
(3) Search and perform operations on the array of objects
Project Description:
The input csv file for this project consists of rows of data that deals with COVID-19 cases and deaths per day for each county in every state in the United States. Here is an example,
date,county,state,fips,cases,deaths
2020-01-21,Snohomish,Washington,53061,1,0
2020-01-22,Snohomish,Washington,53061,1,0
2020-01-23,Snohomish,Washington,53061,1,0
For the purposes of this project, we will assume that the following are char* data types: date, county, and state. FIPS (unique identifier for each county) along with cases and deaths are int data types. Please note the comma delimiter in each row. You need to carefully read each field knowing that you will have a comma.
You will use redirected input (more later) to read an input txt file that contains the following:
counts //number of data entries in the csv file
Filename.csv //this is the file that contains the covid-19 data
Command //details of what constitutes a command is given below
Command
Command
….
Your C++ program will read the counts value on the first line of the txt file, which represents the number of data entries in the csv file. (Note - the first line of the csv file contains descriptive variable fields, so there will be a total of [number of data entries + 1] lines in the csv file). Then, on the second line, it will read the Filename.csv and open the file for reading (more on how to do this in C++). After you open the file, you will read the data from each row of the csv file and create a COVID19 object. The COVID19 class is given below. You need to implement all of the necessary methods.
class COVID19 {
protected:
char* date;
char* county;
char* state;
int fips;
int cases;
int deaths;
public:
COVID19 (); //default constructor
COVID19 (char* da, char* co, char* s, int f,
int ca, int de); //initializer
display ();
//write all accessors and other methods as necessary
};
After your write the above class you will write the following class:
class COVID19DataSet {
protected:
COVID19* allData;
int count; //number of COVID19 objects in allData
int size; //maximum size of array
public:
COVID19DataSet (); //default constructor
COVID19DataSet (int initSize);
void display ();
void addRow (COVID19& oneData);
int findTotalCasesByCounty (char* county, char* state);
int findTotalDeathsByCounty (char* county, char* state);
int findTotalCasesByState (char* state);
int findTotalDeathsByState (char* state);
int findTotalCasesBySateWithDateRange (char* state,
char* startDate, char* endDate);
int findTotalDeathsBySateWithDateRange (char* state,
char* startDate, char* endDate);
~COVID19(); //destructor
//other methods as deem important
};
The structure of the main program will be something like this:
#include
using namespace std;
// Write all the classes here
int main () {
int count.
This is my attempt at a look at some of the features of C++11, and more importantly, describing some of the style changes in C++11 that will make programmers more productive and programs more efficient.
write the To Dos to get the exact outputNOte A valid Fraction .pdfjyothimuppasani1
write the To Do\'s to get the exact output:
NOte: A valid Fraction number has a non-negative numerator and a positive denominator.
Default constructor initializes the object to safe empty state (an object with denom equals -1).
The two-argument constructor also validates the parameters and sets the object to the safe empty
state if the parameters are not valid.
Write the definitions and prototypes of following functions in Fraction.cpp and Fraction.h
respectively (They are indicated in the files by //TODO tag):
Define isEmpty function as a member function, which returns true if the object is in safe empty
state (an object is in the safe empty state if denominator (denom) equals -1).
Define display function, which sends a Fraction number to the output stream (with the
“Numerator/denominator” format). This function just prints \"Invalid Fraction Object!\" in the
screen if the object is in the safe empty state. In case that object denominator equals 1, it just
print the numerator.
Define the operator functions for the following operators:
“+=”, “+”, “*”
The overload of the above operators should make the following code possible:
The member operator+ : Adds two Fraction numbers and returns a Fraction number as the result.
This function returns an object with the safe empty state if either of Fraction numbers (operands)
is in safe empty state. It makes following code possible:
A+B ( where A and B are Fraction objects)
The member operator+= : Adds two Fraction numbers and assigns the result to the left operand,
then returns a reference to the left operand. If either of Fraction numbers (operands) is in safe
empty state, it initializes the left operand to the safe empty state, then returns a reference to the
left operand. It makes following code possible:
A+=B ( where A and B are Fraction objects)
The member operator* : Multiplies two Fraction numbers and returns a Fraction number as the
result. This function returns an object with the safe empty state if either of Fraction numbers
(operands) is in safe empty state. It makes following code possible:
A*B ( where A and B are Fraction objects)
fraction.cpp
#include \"Fraction.h\"
using namespace std;
namespace sict{
Fraction::Fraction(){
denom =-1; // safe empty state
}
Fraction::Fraction(int n, int d) // n: numerator, d: denominator
{
if(n >= 0 && d > 0){
num = n;
denom = d;
reduce();
}
else
denom =-1; // set to safe empty state
}
int Fraction::gcd() // returns the greatest common divisor of num and
denom
{
int mn = min(); // min of num and denom
int mx = max(); // mX of num and denom
for (int x=mn ; x > 0 ; x--) // find the greatest common divisor
if( mx % x == 0 && mn % x == 0)
return x;
return 1;
}
void Fraction::reduce() // simplify the Fraction number
{
int tmp = gcd();
num /= tmp;
denom /= tmp;
}
int Fraction::max ()
{
return (num >= denom) ? num : denom;
}
int Fraction::min()
{
return (num >= denom) ? denom : num;
}
// in_lab
// TODO: write the implementation of display function HERE
// TODO: w.
Demonstrate cultural awareness of the Aboriginal andor Torres Strai.pdfAggarwalelectronic18
Demonstrate cultural awareness of the Aboriginal and/or Torres Strait Islander local community
Students may research the local Aboriginal and/or Torres Strait Islander community resources
and prepare a presentation on various interesting aspects of their history, land, language, and
communication- mannerisms, common Aboriginal and/or Torres Strait Islander words.
Please include Reference thank you.
Deposit insuranceGroup of answer choicesleads depositors to be .pdfAggarwalelectronic18
Deposit insurance:
Group of answer choices
leads depositors to be less inclined to monitor bank operations.
often makes banks more accountable for their actions and less likely to engage in risky behavior.
essentially serves the same function as a fractional reserve system.
can increase the possibility of bank runs Deposit insurance: leads depositors to be less inclined to
monitor bank operations. often makes banks more accountable for their actions and less likely to
engage in risky behavior. essentially serves the same function as a fractional reserve system. can
increase the possibility of bank runs.
Define the role of digital and social media in advertising and IBP a.pdfAggarwalelectronic18
Define the role of digital and social media in advertising and IBP along with the option available
to brands.
Describe the basics of e-commerce as related to IBP and how it can stem from e-advertising,
social media, mobile, and e-search.
Explain the advantages of digital, mobile, and social media for implementing advertising and
IBP campaigns along with the dark side of social media such as security and privacy concerns..
Deep Learning for Vision Systems Given the following neural network .pdfAggarwalelectronic18
Deep Learning for Vision Systems Given the following neural network with fully connection
layer and ReLU activations, including two input units (i1,i2), four hidden units (h1,h2) and
(h3,h4).The output units are indicated as (o1,o2) and their targets are indicated as (t1,t2). The
weights and bias of fully connected layer are called w and b with specific sub-descriptors. The
values of variables are given in the following table: a) Compute the output (o1,o2) with the input
(i1,i2) and network parameters as specified above. Write down all calculations, including
intermediate layer results. b) Compute the mean squared error of the output (o1,o2) calculated
above and the target (t1,t2). c) Update the weight w21 using gradient descent with learning rate
0.1 as well as the loss computed previously. (Please write down all your computations.).
Debra Company began operations on June 1. The following transactions.pdfAggarwalelectronic18
Debra Company began operations on June 1. The following transactions took place in June: a.
Purchases of merchandise on account were $1,200,000. b. The cost of freight to receive the
inventory was $40,000. This was paid in cash. c. Debra returned $20,000 of the merchandise due
to an ordering error. Debra received a full credit for the return. d. Debra paid the remaining
balance for the merchandise. Calculate the dollar amount that Debra will have in inventory at.
De Yahoo!Finance, identifique la versi�n beta de las acciones de cua.pdfAggarwalelectronic18
De Yahoo!Finance, identifique la versin beta de las acciones de cuatro empresas: una empresa de
servicio de alimentos (restaurante) llamada Denny's Corporation (smbolo de accin DENN),
Amazon (AMZN), Caterpillar Inc. (CAT) y Waste Management (WM) . Qu empresa (o
empresas) tiene una beta ms alta (superior a 1,0)? Y qu empresa (o empresas) tiene una beta ms
baja (menos de 1,0)? Por qu?.
Danone North America, un fabricante de productos l�cteos y de origen.pdfAggarwalelectronic18
Danone North America, un fabricante de productos lcteos y de origen vegetal, vende crema para
caf, leche y yogures. Comercializa una serie de yogures, incluidos dannon AII natural, dannon
fruit on the bottom, dannon light & Fit, DanActive y danonino. La gran variedad de yogures
vendidos por la marca danone es colectivamente un ejemplo de ____.
A. mezcla de productos
B mercado objetivo
C lnea de productos
D segmento de mercado.
Curtis y Norma est�n casados y presentan una declaraci�n conjunta. C.pdfAggarwalelectronic18
Curtis y Norma estn casados y presentan una declaracin conjunta. Curtis aport $1000 a su plan
401(k) en 2021. Norma aport $1000 a una cuenta IRA en 2021. Su ingreso bruto ajustado
combinado de 2021 es de $33 500. Qu monto pueden reclamar Curtis y Norma para el Crdito por
aportes calificados de ahorro para la jubilacin (Crdito del ahorrador) en su declaracin de
impuestos?
R. $0
B $100
C$500
D $1,000.
Cultura y comercio el panorama internacional a las 900 horas; co.pdfAggarwalelectronic18
Cultura y comercio: el panorama internacional
a las 9:00 horas; comienza la reunin. Rpidamente notas que Teresa tena razn. Todava hay
algunos asientos vacos en la sala de conferencias.
Mientras observa la primera lista de asistentes destacados, comienza a preguntarse cmo las
personas que viajaron a la conferencia durante el fin de semana pudieron llegar tarde>
Gerentes destacados
Dirigido por Teresa Gonzlez, VP de Gestin de Productos Globales
Escaneas la corona y notas que Rogelio an no ha llegado. Considera que su tardanza puede
deberse a qu fuerza externa internacional?
1. sociocultural
2. legales
3. Econmico
4. Poltica.
Curso --- Comportamiento Organizacional (OBR250)
Lea Aceptando el desafo Pepsi: el caso de Indra Nooyi en su texto en la seccin 12.1
Preguntas:
1. Indra Nooyi no es un CEO tpico.
a. En qu se diferencia de su idea de cmo es un director ejecutivo tpico? (2.5 puntos)
b. Cmo cree que se cre su imagen actual de CEO? (2.5 puntos)
2. Indra Nooyi es promocionada como "inusualmente colaboradora" para alguien a cargo de una
empresa Fortune 500. Por qu cree que su nivel de colaboracin es tan inusual para los altos
ejecutivos? (5 puntos).
Cultural Tourism ProductsThe environmental bubble is essentially a.pdfAggarwalelectronic18
Cultural Tourism Products
The environmental bubble is essentially a social or cultural safety blanket that surrounds the
tourist with the known or familiar, enabling the person to sample the unfamiliar, while not being
overwhelmed by it. Examine a cultural tourism product and identify how the environmental
bubble was created for that product. Explain the benefits to the consumer, site manager and the
local tourism industry. 350-400 words.
Please add Chicago style references.
Cuando se trata de servicios sociales como salud, educaci�n y bienes.pdfAggarwalelectronic18
Cuando se trata de servicios sociales como salud, educacin y bienestar, la responsabilidad de
dirigir e implementar estas polticas pertenece en gran medida a
los gobiernos locales.
tanto los gobiernos federales como los locales.
el Gobierno federal.
los gobiernos de los estados.
1 puntos
PREGUNTA 8
La mayor parte del suroeste de Estados Unidos, incluidos los actuales Arizona, California,
Colorado, Nevada, Nuevo Mxico, Utah y Wyoming, se adquiri debido a qu evento histrico?
la compra de luisiana
la guerra mexicano-estadounidense
la guerra hispanoamericana
La guerra civil
1 puntos
PREGUNTA 9
En los Estados Unidos, la mayora de las elecciones se llevan a cabo utilizando un sistema de
mayora relativa de distritos uninominales. Esto ha contribuido a
un poder ejecutivo fuerte.
el dominio de slo dos grandes partidos polticos.
un poder ejecutivo dbil.
gerrymandering
1 puntos
PREGUNTA 10
Desde la administracin Reagan, ha habido una disminucin notable en los gastos de asistencia
social. Cul ha sido el principal impacto de esta tendencia?
mayor desigualdad de ingresos
una fuerza de trabajo ms productiva
menos deuda del gobierno
aumento de la prdida de empleos y la subcontratacin de empresas estadounidenses
1 puntos
PREGUNTA 11
Segn el censo de los Estados Unidos, cul es el grupo religioso ms grande de los Estados Unidos?
musulmn
protestante
catlico romano
no especificado, no afiliado o ninguno
1 puntos
PREGUNTA 12
Cul de las siguientes es cierta con respecto al Tea Party?
Es un movimiento histrico y puede rastrear sus orgenes varias dcadas atrs a la oposicin a las
polticas de bienestar social de los presidentes Franklin Roosevelt y Lyndon Johnson.
Sus partidarios son solo un pequeo fragmento (menos del 5 por ciento) de la poblacin
estadounidense.
Favorece muchas polticas que estn fuera de sintona con las posiciones polticas republicanas
tradicionales, incluido el nacionalismo econmico (oposicin al libre comercio).
Es un movimiento conservador unificado, que representa una proporcin significativa del Partido
Republicano. a.
los gobiernos locales. b.
tanto los gobiernos federales como los locales. C.
el Gobierno federal. d.
los gobiernos de los estados..
Cuando se introdujo el euro en 1999, Grecia brillaba por su ausencia.pdfAggarwalelectronic18
Cuando se introdujo el euro en 1999, Grecia brillaba por su ausencia en la lista de pases
miembros de la UE que adoptaron la moneda comn. El pas no estaba preparado. Sin embargo, en
unos pocos aos, los lderes europeos, probablemente motivados por su agenda poltica,
permitieron que Grecia se uniera al club del euro en 2001, aunque no estaba del todo claro si el
pas cumpla con las condiciones de entrada. En cualquier caso, unirse al club del euro permiti que
el gobierno griego, los hogares y las empresas obtuvieran un fcil acceso a abundantes fondos a
tasas de inters histricamente bajas, lo que marc el inicio de un perodo de slido crecimiento del
crdito. Durante un tiempo, los griegos disfrutaron de lo que parecan ser los frutos de convertirse
en miembros de pleno derecho de Europa. En diciembre de 2009, sin embargo, el nuevo
gobierno griego revel que el dficit presupuestario del gobierno sera del 12,7 por ciento para
2009, no del 3,7 por ciento como haba anunciado previamente el gobierno saliente, superando
con creces la directriz de convergencia de la UE de mantener el dficit presupuestario por debajo
del 3,0 por ciento del PIB. A medida que se conoci la verdadera imagen de las finanzas del
gobierno, los precios de los bonos del gobierno griego comenzaron a caer bruscamente, lo que
provoc ventas de pnico entre los inversores internacionales, amenazando con los
incumplimientos soberanos. Varios aos despus de la crisis, la deuda del gobierno griego se sita
en torno al 180 % del PIB y la tasa de desempleo entre los jvenes supera el 50 %. El PIB del pas
se redujo en un 25 por ciento. Se impusieron severas medidas de austeridad, como fuertes
aumentos de impuestos y beneficios de pensiones muy reducidos, a Grecia como condiciones
para los rescates organizados por la UE, el FMI y el Banco Central Europeo. Adems, a las
personas solo se les permiti tener acceso restringido a sus depsitos bancarios, para evitar corridas
bancarias. Las encuestas de opinin indican que la mayora de la gente en Alemania, la principal
nacin acreedora de Grecia, prefiere la salida griega de la zona euro, popularmente llamada
Grexit, mientras que algunas personas en Grecia exigen Grexit y la restauracin de la moneda
nacional. , el dracma.
Discuta los siguientes puntos: 1. Cules fueron los problemas socioeconmicos que causaron la
crisis econmica en Grecia en 2010?
2. Durante la crisis de 2010, cules cree que fueron los costes y los beneficios de permanecer en
la zona euro para Grecia?
3. Cules seran las medidas que habra que tomar para mantener a Grecia en la zona euro a largo
plazo?.
Create your own Wikipedia pageWikipedia is one of the backbones of.pdfAggarwalelectronic18
Create your own Wikipedia page
Wikipedia is one of the backbones of the Internet, and it has a relatively simple layout. Create a
Wikipedia page on the topic of your choice. It should include:
A title or heading
A table of contents with links to sections within the page
Superscript number links that link to the corresponding number in the reference section
An ordered list of references
at least three images with figure / captions explaining what they are.
Create the tables for your final project database using Design View.pdfAggarwalelectronic18
Create the tables for your final project database using Design View:
For example:
Patients
Visits
For each table, include all the relevant information about each field.
Field name
Data Type
Description of data element
Field Size
Caption
Primary Key
When selecting the Data Type for the following fields, select "Lookup Wizard" to create lookup
values for the field.
Gender
Race
Type of Admission
Discharge Status
Primary Insurance
Include an entity relationship diagram to show the one to many relationship between the Patients
table an the Visits table.
Create an Access database and name it "Project "
Do not include the following fields
Ethnicity
Secondary Diagnoses
Present on Admission
Secondary Procedures
Secondary Procedure Dates
Total Charges DATA DICTIONARY - UHDDS
ifindualpat.
Create a timeline that visually details the implementation steps of .pdfAggarwalelectronic18
Create a timeline that visually details the implementation steps of the capstone project. The
timeline should be separated by weeks. It is helpful to organize the implementation plan into
smaller, short-term goals. The timeline should estimate when the following tasks should be
completed.
Implementation Steps: Distinguish organizational resources needed to implement and maintain
the change plan. Identify the stakeholders needed to support the implementation of the proposed
plan. Identify communication strategies to internal and external stakeholders to facilitate a
change plan. Determine the type of impact this change plan will have on the organization and its
stakeholders. Discuss the expected outcomes for you initiating your proposal. Identify potential
barriers to implementing the change plan. Identify steps for overcoming the potential barriers..
Create a UML deployment and component diagram for the scenario below.pdfAggarwalelectronic18
Create a UML deployment and component diagram for the scenario below
A PC has the following hardware and software:
PC Hardware List:
- Base Station(Tower)
- Keyboard
- Combined CS and DVD Recorder (ComboRecorder
- Motherboard
-Screen
- Mouse
PC Software List:
- Windows 9,
- Ms Office 2027
- Firefox
- DOS
- Norton Commander
A PC has the following hardware and software:
PC Hardware List:
- Base Station(Tower)
- Keyboard
- Combined CS and DVD Recorder (ComboRecorder
- Motherboard
-Screen
- Mouse
PC Software List:
- Windows 9,
- Ms Office 2027
- Firefox
- DOS
- Norton Commander.
Create a resume for yourself 1. 1-2 Pages 2. Any of the foll.pdfAggarwalelectronic18
Create a resume for yourself
1. 1-2 Pages
2. Any of the following types: Chronological Functional, Targeted
3. Include the following sections: Heading, Objective OR Personal/Professional Statement OR
Branding Statement, Education, Skills & Qualifications, Work Experience, Volunteer (if
applicable).
4. Use at least 5 different verbs.
5. Include 2-3 Achievement Statements
Milestone 1 - Draft of work experience section
Milestone 2 - Format and fill in details & editing.
Create a GUI application in Java that allows users to chat with each.pdfAggarwalelectronic18
Create a GUI application in Java that allows users to chat with each other over a network using
sockets. The application should consist of two parts: a client and a server. The client GUI should
have the following features: A text field where users can enter their messages A send button to
send messages to the server A text area to display the conversation history A login screen to
authenticate users The server GUI should have the following features: A.
create a cross section for X-Y create a cross section based on.pdfAggarwalelectronic18
create a cross section for X-Y
create a cross section based on the red line 2. The map below is slightly more complicated
situation in an area of different rock types, but still similar to those you've just seen in the
previous example. Construct a structure section across line A-A' and then answer the questions.
Fossilferous Limestone
Horizontal Sandstone Conglomerate bedding 40 Dip of bedding Limestone Granodiorite -100 L
Land contours at 100m intervals Shale Granite Rock unit boundary Contact metamorphism
Dolerite Mudstone.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
2. fields.push_back(field);
}
return fields;
}
CountryData parseCountryData(const string& line) {
vector fields = split(line, ',');
if (fields.size() != 12) {
throw runtime_error("invalid line: " + line);
}
string name = fields[0];
double pop1980 = fieldToDouble(fields[1]);
double pop2010 = fieldToDouble(fields[11]);
return CountryData(name, pop1980, pop2010);
}
vector readCountryData(const string& filename) {
vector countryDataList;
ifstream infile(filename);
if (!infile) {
throw runtime_error("unable to open file: " + filename);
}
string line;
while (getline(infile, line)) {
try {
CountryData countryData = parseCountryData(line);
countryDataList.push_back(countryData);
}
catch (const runtime_error&) {
// ignore the error; just don't add this one to the vector
}
}
return countryDataList;
}
vector ReadCountryData(const string & filename)
{
vector data;
ifstream ifs{ filename };
3. string line;
// Read the header line
getline(ifs, line);
while (getline(ifs, line)) {
try {
CountryData cd = ParseCountryData(line);
data.push_back(cd);
}
catch (runtime_error & e) {
string error{ e.what() };
}
}
return data;
}
CountrtyData.h
#pragma once
#include
#include
class CountryData
{
public:
CountryData(const std::string & n, double p1, double p2);
std::string GetName() const;
double CalcGrowth() const;
private:
std::string name;
double pop1980;
double pop2010;
};
CountryData ParseCountryData(const std::string& line);
std::vector ReadCountryData(const std::string& filename);
utilities.h
#pragma once
4. #include
#include
// Split a string into sub-strings based on the given
// delimiter. For example, if the input is
//
// Ron,Ginny,George,Fred,Percy,Bill,Charlie
//
// the output is a 7-element vector with
// the following entries:
//
// [0] = "Ron"
// [1] = "Ginny"
// [2] = "George"
// [3] = "Fred"
// [4] = "Percy"
// [5] = "Bill"
// [6] = "Charlie"
//
std::vector split(const std::string& s, char seperator);
// Converts a database field string to an integer.
// If the field cannot be converted to an int,
// a runtime_error exception is thrown.
int fieldToInt(const std::string & field);
// Converts a database field to a double.
// If the field cannot be converted to an double,
// a runtime_error exception is thrown.
double fieldToDouble(const std::string & field);
utilities.cpp
#include
#include
#include "utilities.h"
std::vector split(const std::string & s, char sep)
{
std::vector fields;
size_t i = 0;
5. size_t len = s.length();
while (i < len) {
// Skip characters until we find a separator.
size_t j = i;
while ((i < len) && (s[i] != sep))
i++;
// Add this field - which may be empty! - to the output.
if (j == i)
fields.emplace_back();
else
fields.emplace_back(&s[j], i - j);
// Skip past the separator.
i++;
// If this put us at the end of the string,
// we need to account for the blank field at
// the end.
if (i == len)
fields.emplace_back();
}
return fields;
}
int fieldToInt(const std::string & field)
{
if (field.length() == 0)
throw std::runtime_error("Cannot convert 0-length string");
if (field == "--" || (field == "NA"))
throw std::runtime_error("No data provided");
return strtol(field.c_str(), NULL, 10);
}
double fieldToDouble(const std::string & field)
{
if (field.length() == 0)
throw std::runtime_error("Cannot convert 0-length string");
if (field == "--" || (field == "NA"))
throw std::runtime_error("No data provided");
return strtod(field.c_str(), NULL);
6. }
CountryDataTest.cpp
#include
#include
#include
#include "CountryData.h"
bool CompareGrowth(const CountryData& lhs, const CountryData& rhs)
{
return lhs.CalcGrowth() < rhs.CalcGrowth();
}
int main()
{
std::vector data = ReadCountryData("population_by_country.csv");
if (data.size() == 0)
{
std::cout << "No data read!n";
return 1;
}
auto iters = minmax_element(std::begin(data), std::end(data), CompareGrowth);
auto min_iter = iters.first;
auto max_iter = iters.second;
std::cout << max_iter->GetName()
<< " had the highest growth at "
<< max_iter->CalcGrowth()
<< " million.n";
std::cout << min_iter->GetName()
<< " had the lowest growth at "
<< min_iter->CalcGrowth()
<< " million.n";
std::string country;
while (std::getline(std::cin, country))
{
auto iter = std::find_if(std::begin(data), std::end(data),
[&country](const CountryData & c)
{
7. return c.GetName() == country;
});
if (iter == std::end(data))
std::cout << "There is no data for " << country << 'n';
else
std::cout << "The population of " << country << " increased by "
<< std::fixed << std::setprecision(2)
<< iter->CalcGrowth() << " million from 1980 to 2010.n";
}
}
REVISION NOTE 4/17/2020: Since are covering some material in a different order than
originally planned, more of this lab was already done for you. Every file but CountryData.cpp is
read-only, so you only need to do the TODOs in that file. The function ReadcountryData is
actually already complete. In this lab, you will implement a very simple class called CountryData
that stores some population data for a country, and (more importantly) write functions to: - parse
a line of text and convert it to a countryData object - read a file line by line and return a vector
containing all the valid data in the file The CountryData class contains three data members: - The
name of the country. - The population of the country in 1980 - The population of the country in
2010 This data will be read from a file called population_by_country.csv, each line of which
looks like this: Canada,
24.5933,24.9,25.2019,25.4563,25.7018,,32.65668,32.93596,33.2127,33.48721,33.75974 (I've
elided some data to make it fit on one line.) The data consists of fields separated by commas -
thus it's referred to as a "comma-separated values" file. (Spreadsheets can read these directly - try
it.) The first field is the name of the country, and the others are the population values in millions
from 1980 to 2010. I've provided a header file containing the declaration of the countryData
class; all you need to do is to fill in the details. The class itself should be easy; all you need to do
is: - Finish the constructor - Implement getName(), which simply returns the country name -
Implement calcGrowth0, which calculates the population growth from 1980-2010 Each of these
can actually be done in one line, though taking more than one line may help readability. The hard
part will be the two functions that actually read the data. The first is parsecountryData (), whose
signature is: CountryData parseCountryData(const std: :string & line); The line argument is one
line of the file. The function needs to split the data into separate fields (using a split () function
that I'll provide), and then return a CountryData object. The county name is the first field, the
8. 1980 population is the second, and the 2010 population is the last. The population data will need
to be converted from std: : string to double. I've provided a function called fieldToDouble() that
recommend you use rather than writing your own. The fieldToDouble() function that I provide
will throw an exception for invalid floating-point data. The exception should NOT be caught in
parsecountryData(); see below. The second function is readCountryData(), whose signature is:
The second function is readCountryData(), whose signature is: std: : vector readCountryData
(const std: string a filename); This function needs to open the file as an ifstream, and use
getline() to read the file line by line. It should call parseCountryData() to convert this line of data
to a countryData object, and store each valid line in a vector. This vector is the return value of
the function. The call to parsecountryData( ) should be wrapped in a try block. Recall that the
syntax is: try { / call parsecountryData() // add this CountryData to the vector } catch (std:
runtime_error &e e { // ignore the error; just don't add this one to the vector In case we have not
covered exceptions by the time you do this lab, this code is provided for you. Provided functions
I've provided utilities.h and utilities. cpp which declare/define these functions: double
fieldToDouble (const std: string & field); fieldToDouble() converts the given std: : string to a
floating point value, which is returned as a double. It does some basic error checking, and throws
an exception if the field cannot be converted. std: :vector split(const std: :string & s, char sep);
split () separates the given std: : string into individual fields based on the given separator
character. The fields are returned as a vector. I've also provided Title_ratings.cpp from a
different project. You can use that as a guide for writing your parseCountryData() function.