Using the data set as a pre-defined variable in your program, write code that uses the dataset to print the first names of people who have BOTH above average math grades AND below average age from the dataset.
The solutions for the textbook examples assume you are able to export in a framework like node.js, which is why in the data set I provide, I simply set the array of objects as a variable. Your code will be in the same file (treat it like any other array variable). You can do the same with the sample files the chapter provides. For example:
var ancestry = [
{
.. object ..
},
...
]
// your code here
Requirements:
var dataSet = [
{
"name": "Maura Glass",
"age": 60,
"math": 97,
"english": 63,
"yearsOfEducation": 4
},
{
"name": "James Gates",
"age": 55,
"math": 72,
"english": 96,
"yearsOfEducation": 10
},
{
"name": "Mills Morris",
"age": 26,
"math": 83,
"english": 77,
"yearsOfEducation": 10
},
{
"name": "Deena Morton",
"age": 57,
"math": 63,
"english": 63,
"yearsOfEducation": 10
},
{
"name": "Edith Roth",
"age": 38,
"math": 79,
"english": 94,
"yearsOfEducation": 10
},
{
"name": "Marva Morse",
"age": 31,
"math": 93,
"english": 78,
"yearsOfEducation": 9
},
{
"name": "Etta Potts",
"age": 48,
"math": 57,
"english": 93,
"yearsOfEducation": 7
},
{
"name": "Tate Moss",
"age": 22,
"math": 83,
"english": 64,
"yearsOfEducation": 8
},
{
"name": "Sanders Burris",
"age": 27,
"math": 65,
"english": 66,
"yearsOfEducation": 5
},
{
"name": "Latoya Malone",
"age": 35,
"math": 100,
"english": 100,
"yearsOfEducation": 5
},
{
"name": "Wade Foreman",
"age": 25,
"math": 76,
"english": 87,
"yearsOfEducation": 10
},
{
"name": "Miller Valentine",
"age": 31,
"math": 56,
"english": 89,
"yearsOfEducation": 6
},
{
"name": "Rita Olson",
"age": 53,
"math": 100,
"english": 52,
"yearsOfEducation": 6
},
{
"name": "Potter Newton",
"age": 29,
"math": 91,
"english": 75,
"yearsOfEducation": 5
},
{
"name": "Madeline Bartlett",
"age": 23,
"math": 60,
"english": 74,
"yearsOfEducation": 10
},
{
"name": "Tamara Tran",
"age": 46,
"math": 73,
"english": 78,
"yearsOfEducation": 4
},
{
"name": "Elena Evans",
"age": 43,
"math": 60,
"english": 82,
"yearsOfEducation": 10
},
{
"name": "Cote Merrill",
"age": 55,
"math": 86,
"english": 63,
"yearsOfEducation": 7
},
{
"name": "Madeleine Brennan",
"age": 52,
"math": 82,
"english": 88,
"yearsOfEducation": 4
},
{
"name": "Alford Weber",
"age": 38,
"math": 71,
"english": 85,
"yearsOfEducation": 4
},
{
"name": "Kirsten Daniel",
"age": 35,
"math": 86,
"english": 61,
"yearsOfEducation": 8
},
{
"name": "Melton Chan",
"age": 26,
"math": 55,
"english": 96,
"yearsOfEducation": 4
},
{
"name": "Mcmahon Woodward",
"age": 54,
"math": 56,
"english": 63,
"yearsOfEducation": 9
},
{
"name": "Helga Monroe",
"age": 29,
"math": 79,
"english": 92,
"yearsOfEducation": 5
},
{
"name": "Patricia Herrera",
"age": 46,
"math": 94,
"english": 99,
"yearsOfEducation": 10
},
{
"name": "Mccullough Lambert",
"age": 56,
"math": 65,
"english": 96,
"yearsOfEducation": 8
},
{
"name": "Haynes Davidson",
"age": 60,
"math": 86,
"english": 50,
"yearsOfEducation": 5
}
]
In: Computer Science
Three single-phase transformers are used in a Y-Y configuration to supply a load rated 4000 V, and drawing 80 kW at a power factor of 0.72 (lagging), independently of the voltage. Each transformer, rated 14500/2300 V, 40 kVA, has the following parameters in pu: series elements: 0.01 (resistive), 0.06 (inductive); magnetizing branch: 70 (resistive), 20 (inductive).
(a) Assume the transformer is ideal and the phase voltage at the primary is 13000 V. Draw the per phase equivalent circuit of the transformer and load. Give the phase voltage and current. Indicate if the transformer is overloaded. Compute the real and reactive power drawn from the feeder. Draw the per-phase V-I diagram and power diagram seen from the primary side.
(b) Draw the per phase equivalent circuit of the transformer, indicating parameters in pu and Ohm referred to the primary. Draw the equivalent circuit used under no-load and full load conditions seen from the primary side in pu and Ohm. For operation under load, draw the series impedance diagram and compute the impedance in Ohm and angle. Estimate the per phase transformer losses at rated voltage and current in pu and in kW. Find the efficiency for the given load. Indicate the impact on losses and efficiency of using a transformer with a 0.02 pu series reactance and a 100 pu core resistance.
(c) For rated voltage on the primary side and a short circuit across the load with an impedance of 0.10 pu resistive, compute the current in A as seen from the primary side. Draw the V-I diagram. Compute the current if the fault impedance is 0 and compare the 2 values. Indicate, for a 0.10 resistive short, the impact on the fault current of using a transformer with a 0.02 pu series reactance and a 100 pu core resistance. Compare the fault impedance and V-I diagrams.
In: Physics
1.
A parent company be prosecuted because of failures within a subsidiary company
True
False
2.
When an employee is killed while driving on work-related business, the employer organisation could be prosecuted for corporate manslaughter.
True
False
3.
The Corporate Manslaughter and Corporate Homicide Act 2007, is not retrospective and therefore can apply to deaths before its implementation date.
True
False
4.
When deciding what constitutes gross negligence it can be said that negligence turns into gross negligence if the breach of duty falls considerably below what would reasonably be expected of the organisation in the circumstances. Whether the negligence is gross negligence depends upon considerations such as: (tick all that apply)
Any health and safety guidance relating to the breach
The cost of installing safety systems and taking precautions
The attitudes, policies and accepted practices of the organisation which led to the failure
That there were no mitigating factors
Whether other people involved in the incident suffered serious injuries
How serious the failure was
How real the risk of death was
The number of people who died
5.
Historically in larger companies, it was often difficult to prove that the actions of one director or manager controlled the whole company. In the case of large companies, the prosecution often tried to secure a conviction for breach of the Health and Safety at Work Act 1974 which is easier to prove. Which of the cases listed below (which occurred before the CMCHA 2007 )resulted in convictions for corporate manslaughter? (Tick all that apply)
R v Kite, Stoddard and OLL Ltd [1994]
R v Cotswold Geotechnical (Holdings) Ltd [2011]
Tesco Supermarkets Ltd. v Nattrass [1971]
R. v P & O European Ferries (Dover) Ltd. (1990)
Williams v Farne Salmon and Trout Ltd 1988
R v Princes Sporting Club Limited (2013)
In: Accounting
Profit maximization does not adequately describe the goal of the firm because
| I. |
profit maximization does not require the consideration of risk |
|
| II. |
profit maximization considers the timing of a project's return |
|
| III. |
maximization of dividend payout ratio is a better description of the goal of a firm |
|
| IV. |
both I and II |
|
| V. |
None of the above |
Which of the following goals of the firm are synonymous
(equivalent) to the maximization of shareholder wealth?
I. profit maximization
II. risk minimization
III. maximization of the total market value of the firm's common
stock
IV maximization of market price per share
| I. |
I and II only |
|
| II. |
II and III only |
|
| III. |
III and IV only |
|
| IV. |
I and III only |
|
| V. |
I and IV only |
The true owners of the corporation are the
| I. |
holders of debt issues of the firm |
|
| II. |
none of the above |
|
| III. |
common stockholders |
|
| IV. |
board of directors |
|
| V. |
preferred stockholders |
Ms Tamika, a financial manager of a corporation, is considering numerous different operating strategies for the coming year. From a financial management standpoint, which of the following would be her optimal strategy?
| I. |
To undertake the plan that would be of least risk to the firm |
|
| II. |
To undertake the plan that would maximize the current price of existing stock |
|
| III. |
To undertake the plan that would result in a profit for the year |
|
| IV. |
To undertake the plan that would be least expensive for the firm |
|
| V. |
None of the above |
Which of the following categories of owners enjoy limited liability?
| I. |
general partners in a limited partnership |
|
| II. |
None of the above. |
|
| III. |
shareholders (common stock) of a corporation |
|
| IV. |
sole proprietors |
|
| V. |
both a and b |
Which of the following Mechanisms is used by shareholders to motivate management?
| I. |
Threat of Firing |
|
| II. |
Leveraged Buyouts |
|
| III. |
Managerial Compensation |
|
| IV. |
Threat of Firing and Managerial Compensation |
|
| V. |
None of the above |
In: Finance
Write an XQUERY to display the information for all students who are not Malaysians or older than 25
<root>
<students>
<element>
<ID>100345</ID>
<Nationality>USA</Nationality>
<Program>ICT</Program>
<age>23</age>
<name>John</name>
</element>
<element>
<ID>100876</ID>
<Nationality>MALAYSIA</Nationality>
<Program>CS</Program>
<age>28</age>
<name>Awang</name>
</element>
<element>
<ID>100257</ID>
<Nationality>AUSTRALIA</Nationality>
<age>25</age>
<name>Alex</name>
</element>
</students>
</root>
In: Computer Science
Using Ruby. Create a program that prompt the users for his full name
For example: Brian Smith
You code should swap the first name to last and last name to first and display the result.
Smith Brian
Your code should run for any combination of first name and last name.
Hint: Research around String class methods in Ruby. The separator is the space in between first and last name.
Please submit your code, as well as screenshot of how your code ran in the console.
In: Computer Science
Write a program that contains a main method and another method named userName. The main method should prompt the user to enter a full name. The userName method takes the full name as an argument and prints the name in reverse order and returns the number of characters in the name. See Sample Output (input shown in blue).
Sample Output
Please enter your FULL name
Billy Joe McCallister
Here is the name Billy Joe McCallister in reverse:
retsillaCcM eoJ ylliB
Billy Joe McCallister consists of 21 characters
In: Computer Science
Create a program that creates a sorted list from a data file. The program will prompt the user for the name of the data file.
Create a class object called group that contains a First Name, Last Name, and Age. Your main() function should declare an array of up to 20 group objects, and load each line from the input file into an object in the array.
The group class should have the following private data elements:
first name ,last name age
The group class should have the following functions:
Constructor(s)
Destructor - optional
Get - read first name, last name, and age from an input stream
Put - write last name, first name, and age to an output stream
The group class should have the following operators:
Your program should do the following:
==============
text file
Ann ember 70
jacob Mark 68
David smith 45
Frank lee 37
John doe 30
Kathleen honor 34
bob ember 42
bob ember 13
Richard start 47
Susan hox 36
In: Computer Science
c++ Create a program that creates a sorted list from a data file. The program will prompt the user for the name of the data file. Create a class object called group that contains a First Name, Last Name, and Age. Your main() function should declare an array of up to 20 group objects, and load each line from the input file into an object in the array. The group class should have the following private data elements: first name ,last name age The group class should have the following functions: Constructor(s) Destructor - optional Get - read first name, last name, and age from an input stream Put - write last name, first name, and age to an output stream The group class should have the following operators: > < == compare the group to another group, using Last name, First name, then age, and return a bool Your program should do the following: Prompt the user for the name of the file Open the file Read the data into the array of group objects (maximum size 20) Close the file Sort the array Display the array ============== text file Ann ember 70 jacob Mark 68 David smith 45 Frank lee 37 John doe 30 Kathleen honor 34 bob ember 42 bob ember 13 Richard start 47 Susan hox 36 Expert Answer
In: Computer Science
PostgreSQL
1. Write a query to join two tables employees and departments to
display the department name, first_name and last_name, hire date,
and salary for all managers who have more than 15 years of
experience.
2. Write a query to join the employees and departments table to find the name of the employee including the name and last name, department ID and department name.
3. Write a SQL query to join three tables of employees, departments, and locations to find the names, including first and last name, job title, department name and ID, of employees working in London.
4. Write a query to concatenate the two tables of employees and yourself to find the employee id, last_name as Employee, and their manager_id and last name as Manager.
5. Write a query to connect to the employee table and to yourself to find the name, including first_name and last_name, and the hiring date for those employees who were hired after employee Jones.
6. Write a query to combine the two employee and department tables to get the department name and the number of employees working in each department.
7. Write a query to find employee ID, title and number of days he worked, who worked in department with ID 90.
8. Write a query to combine the two employee and department tables to display the department ID, department name, and manager name.
In: Computer Science