Questions
In C++ Write the definition for following methods of List data structure. 5. pushFront – The...

In C++

Write the definition for following methods of List data structure.

5. pushFront – The function appends an element in the list at the front. The operation increases the number of elements in the list by one.

6. pushback - The function appends an element in the list at the end. The operation increases the number of elements in the list by one.

7.popFront - The function returns and then removes an element in the list from the front. The operation decreases the number of elements in the list by one.

8.popBack - - The function returns and then removes an element in the list from the end. The operation decreases the number of elements in the list by one.

In: Computer Science

C++ question: Design and implement your own linked list class to hold a sorted list of...

C++ question:

Design and implement your own linked list class to hold a sorted list of integers in ascending order. The class should have member functions for inserting an item in the list, deleting an item from the list, and searching the list for an item. Note: the search function should return the position of the item in the list (first item at position 0) and -1 if not found.

In addition, it should have member functions to display the list, check if the list is empty, and return the length of the list. Be sure to have a class constructor, a class destructor, and a copy constructor for deep copy. Demonstrate your class with a driver program (be sure to include the following cases: insertion at the beginning, end, and inside the list, deletion of first item, last item, and an item inside, searching for an existing/non-existing item, and modifying a list that was initialized to an existing list).

In: Computer Science

A group of college students from Canada, France, and the United Kingdom participate in the international...

A group of college students from Canada, France, and the United Kingdom participate in the international internship exchange program at the hospital where you work, and they are learning more about population health in the United States.

On several occasions, the students have expressed a desire to learn more about why a wealthy country such as the United States does not offer universal health care coverage to its residents. The students argue that the people in their countries are healthier than Americans, that their citizens live longer, and that their countries pay less per capita on healthcare than the United States.

Because you are a recent graduate of CSU-Global with a degree in healthcare management and are a newly promoted member of the management staff, the CEO has asked that you take the lead in ensuring that questions posed by the interns are addressed.

Through your course in population health, you understand that healthcare policies in the United States are influenced by many factors. You have decided to prepare a two- to three-page handout using a table format* that explains some of the historical, political, legal, cultural, and economic influences that shape healthcare policies relevant to population health in the United States.

Consider information presented both in your textbook and that you uncover in your research.

The handout should consist of a two-column table. List the following factors in column one and a detailed explanation of each in column two. See example below*.

The table should include in-text citations and a reference page. Support your assignment with at least three credible sources in addition to the course textbook. At least one source must be peer-reviewed. The CSU-Global Library is a good place to find these sources.

The submission should be two to three pages in length, not including the required title and reference pages.

Format your submission according to the CSU-Global Guide to Writing and APA.

Did you know that the CSU-Global Library has a research guide for Healthcare Management and Administration? Visit http://csuglobal.libguides.com/healthcare-management-administration and http://csuglobal.libguides.com/hcm for specific guides to databases, videos, company and industry research, and more.

*Example of two-column table

FACTOR:

EXPLANATION:

Historical

Political

Legal

Cultural

Economical

Do not need to answer the questions in a table format.

In: Nursing

Write a function that will accept a list of numbers and an integer (n). The function...

Write a function that will accept a list of numbers and an integer (n). The function should return a list containing every nth item from the input list, always starting with the first item in the list. The original list should not be modified.

For example, if the function is passed the list

[8, 3, 19, 26, 32, 12, 3, 7, 21, 16]

and the integer 3, it will return the list

[8, 26, 3, 16]

If the function is passed the list

[8, 3, 19, 26, 32, 12, 3, 7, 21, 16]

and the integer 4, it will return the list

[8, 32, 21]

The function should be general, and work for any list and any value of n.

In: Computer Science

A mass m = 3.27 kg is attached to a spring of force constant k =...

A mass

m = 3.27 kg

is attached to a spring of force constant

k = 60.9 N/m

and set into oscillation on a horizontal frictionless surface by stretching it an amount

A = 0.17 m

from its equilibrium position and then releasing it. The figure below shows the oscillating mass and the particle on the associated reference circle at some time after its release. The reference circle has a radius A, and the particle traveling on the reference circle has a constant counterclockwise angular speed ω, constant tangential speed

V = ωA,

and centripetal acceleration of constant magnitude

ac = ω2A.


(a) Determine the following.

maximum speed of the oscillating mass
m/s

magnitude of the maximum acceleration of the oscillating mass
m/s2

magnitude of the maximum force experienced by the oscillating mass
N

maximum kinetic energy of the oscillating mass
J

maximum elastic potential energy of the spring attached to the mass
J

total energy of the oscillating mass-spring system
J


(b) If the record of time starts when

x = +A

and

v = 0,

determine expressions for the displacement, velocity, and acceleration of the oscillating mass along the x-axis at any time t later. (Your expression should be in terms of the variable t and other numerical values. Assume any numerical values in your expression are in standard SI units, but do not enter units into your expression.)

x =    
v =    
a =    


(c) If the record of time starts when

x = 0

and

v = +ωA,

determine expressions for the displacement, velocity, and acceleration of the oscillating mass along the x-axis at any time t later. (Your expression should be in terms of the variable t and other numerical values. Assume any numerical values in your expression are in standard SI units, but do not enter units into your expression.)

x =    
v =    
a =    

In: Physics

1) Find the uncertainty in kinetic energy. Kinetic energy depends on mass and velocity according to...

1) Find the uncertainty in kinetic energy. Kinetic energy depends on mass and velocity according to this function E(m,v) = 1/2 m v2. Your measured mass and velocity have the following uncertainties     2.58 kg and   0.36 m/s. What is is the uncertainty in energy,  , if the measured mass, m = 4.75 kg and the measured velocity, v = -3.76 m/s? Units are not needed in your answer

2)Find the uncertainty in kinetic energy. Kinetic energy depends on mass and velocity according to this function E(m,v) = 1/2 m v2. Your measured mass and velocity have the following uncertainties     0.47 kg and   2.48 m/s. What is is the uncertainty in energy,  , if the measured mass, m = 3.95 kg and the measured velocity, v = -22.69 m/s? Units are not needed in your answer.

3) The propagation of uncertainty formula for the equation y = ax^2 is

where ,and  . and . The values  and  are the uncertainties on a and x respectively.

If a = -4.5 +/- 0.4 and x = -4.7+/-0.7 then what is the uncertainty on y

4) After a million measurements of thing x, we find a sample mean of 60.45 and standard deviation of 3.24. What chance, in percent (0-100) does the next measurement have of being outside 3 standard deviations from the mean? Do not include the percent sign.

5) Find the uncertainty in a calculated average speed from the measurements of distance and time. Average speed depends on distance and time according to this function v(t,x) = x/t. Your measured distance and time have the following values and uncertainties x = 5.1 meters,   2.8 meters and t = 9.1 seconds and  0.2 seconds. What is the uncertainty in the average speed,  ? Units are not needed in your answer.

In: Physics

A metallic circular plate with radius r is fixed to a tabletop. An identical circular plate...

A metallic circular plate with radius r is fixed to a tabletop. An identical circular plate supported from above by a cable is fixed in place a distance dd above the first plate. Assume that dd is much smaller than r. The two plates are attached by wires to a battery that supplies voltage V.

1) What is the tension in the cable? Neglect the weight of the plate.

Express your answer in terms of the variables d, r, V, and constants ϵ0, pi.

F=

2)

The upper plate is slowly raised to a new height 2d. Determine the work done by the cable by integrating ∫d to 2d F(z)dz, where F(z) is the cable tension when the plates are separated by a distance z.

Express your answer in terms of the variables d, r, V, and constants ϵ0,pi.

W=

3) Compute the energy stored in the electric field before the top plate was raised.

Express your answer in terms of the variables d, r, V, and constants ϵ0, pi.

U=

4) Compute the energy stored in the electric field after the top plate was raised.

Express your answer in terms of the variables d, r, V, and constants ϵ0, pi.

U=

5)

is the work done by the cable equal to the change in the stored electrical energy? If not, why not?

The work done in separating the plates is equal to energy change in the plates.
The work done in separating the plates is equal to the magnitude of the energy change in the plates. This does not mean that the work done is equal to the change in the energy stored in the plates. The work done on the plates is positive but the plates lose energy. The plates are connected to the battery, so the potential difference across them remains constant as they are separated. Therefore charge is forced off of the plates through the battery, which does work on the battery.

In: Physics

Write this program in C++ You are given a source file in your work area for...

Write this program in C++

You are given a source file in your work area for this assignment.

It consists of a declaration for a Val node. There are declarations for three overloaded operator functions, which you must fill in: operator+, operator*, and operator!.

operator+ should implement addition. operator* should implement multiplication.

operator! should reverse the digits of its operand (i.e., of "this") and return the reversed integer. So for example !123 should return 321.

It should be straightforward to reverse an integer. You can extract the least significant digit by using % 10. You can remove the least significant digit by dividing by 10. Other approaches are possible as well.

These operator functions should not be a lot of code. The addition and multiplication can be written in 1-2 lines, and the reverse function within about 10 lines.

Source Code:

#include
using namespace std;

class Val {
   int   v;
public:
   Val(int v=0) : v(v) {}

   friend ostream& operator<<(ostream& out, const Val& v) {
       out << v.v;
       return out;
   }

   Val operator+(const Val& o) const {
       // FILL IN
   }

   Val operator*(const Val& o) const {
// FILL IN
   }

   Val operator!() const {
       // FILL IN
   }
};

int main()
{
   Val values[] = { 2, 44, 19, 4391 };
   const int nv = sizeof(values)/sizeof(values[0]);

   for( int i=0; i<nv; i++ ) {
       cout << values[i] << endl;
       cout << "!" << values[i] << " == " << !values[i] << endl;

       for( int j = i+1; j < nv; j++ ) {
           cout << values[j] << endl;
           cout << values[i] << " + " << values[j] << " == "
               << values[i] + values[j] << endl;
           cout << values[i] << " * " << values[j] << " == "
               << values[i] * values[j] << endl;
       }
   }

   return 0;
}

In: Computer Science

You are given a source file in your work area for this assignment. It consists of...

You are given a source file in your work area for this assignment.

It consists of a declaration for a Val node. There are declarations for three overloaded operator functions, which you must fill in: operator+, operator*, and operator!.

operator+ should implement addition. operator* should implement multiplication.

operator! should reverse the digits of its operand (i.e., of "this") and return the reversed integer. So for example !123 should return 321.

It should be straightforward to reverse an integer. You can extract the least significant digit by using % 10. You can remove the least significant digit by dividing by 10. Other approaches are possible as well.

These operator functions should not be a lot of code. The addition and multiplication can be written in 1-2 lines, and the reverse function within about 10 lines.

***************************************************************************************************************

THIS IS THE GIVEN PROGRAM WHICH I HAVE TO FILL IN.

********************************************************************************************************************

#include <iostream>
using namespace std;

class Val {
   int   v;
public:
   Val(int v=0) : v(v) {}

   friend ostream& operator<<(ostream& out, const Val& v) {
       out << v.v;
       return out;
   }

   Val operator+(const Val& o) const {
       // FILL IN


   }

   Val operator*(const Val& o) const {

       // FILL IN
   }

   Val operator!() const {

       // FILL IN
   }
};

int main()
{
   Val values[] = { 2, 44, 19, 4391 };
   const int nv = sizeof(values)/sizeof(values[0]);

   for( int i=0; i<nv; i++ ) {
       cout << values[i] << endl;
       cout << "!" << values[i] << " == " << !values[i] << endl;

       for( int j = i+1; j < nv; j++ ) {
           cout << values[j] << endl;
           cout << values[i] << " + " << values[j] << " == "
               << values[i] + values[j] << endl;
           cout << values[i] << " * " << values[j] << " == "
               << values[i] * values[j] << endl;
       }
   }

   return 0;
}

In: Computer Science

Make in c++ this Programming Challenge 1. Design your own linked list class to hold a...

Make in c++ this Programming Challenge


1. Design your own linked list class to hold a series of integers. The class should have
member functions for appending, inserting, and deleting nodes. Don’t forget to add a
destructor that destroys the list. Demonstrate the class with a driver program.
2. List Print
Modify the linked list class you created in Programming Challenge 1 to add a print
member function. The function should display all the values in the linked list. Test
the class by starting with an empty list, adding some elements, and then printing the
resulting list out.
3. List Copy Constructor
Modify your linked list class of Programming Challenges 1 and 2 to add a copy constructor.
Test your class by making a list, making a copy of the list, and then displaying
the values in the copy.

List Reverse
Modify the linked list class you created in the previous programming challenges by
adding a member function named reverse that rearranges the nodes in the list so that
their order is reversed. Demonstrate the function in a simple driver program

In: Computer Science