ASSIGNMENT: Write a program and use the attached file (babynames.txt) as input file, and create two output tiles. One file listing out all boys names, and the other file listing out all girls name.
CODE: (teacher gave some of the code below use it to find the answer please String B is the boy names String E is girl names)
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
This program reads a file with numbers, and writes the numbers to
another
file, lined up in a column and followed by their total.
*/
public class Total
{
public static void main(String[] args) throws
FileNotFoundException
{
// Prompt for the input and output file names
Scanner console = new Scanner(System.in);
System.out.print("Input file: ");
String inputFileName = console.next();
System.out.print("Output file1: ");
String outputFileName1 = console.next();
System.out.print("Output file2: ");
String outputFileName2 = console.next();
// Construct the Scanner and PrintWriter objects for reading and writing
File inputFile = new File(inputFileName);
Scanner in = new Scanner("babynames.txt");
PrintWriter out1 = new PrintWriter("boysnames.txt");
PrintWriter out2 = new PrintWriter("girlsnames.txt");
// Read the input and write the output
double total = 0;
while (in.hasNextLine())
{
String A = in.next();
String B = in.next();
String C = in.next();
String D = in.next();
String E = in.next();
String F = in.next();
String G = in.next();
out.printf("%15.2f\n", value);
total = total + value;
}
out.printf("Total: %8.2f\n", total);
in.close();
out.close();
}
}
babynames.txt:
1 Michael 462085 2.2506 Jessica 302962 1.5436
2 Christopher 361250 1.7595 Ashley 301702 1.5372
3 Matthew 351477 1.7119 Emily 237133 1.2082
4 Joshua 328955 1.6022 Sarah 224000 1.1413
5 Jacob 298016 1.4515 Samantha 223913 1.1408
6 Nicholas 275222 1.3405 Amanda 190901 0.9726
7 Andrew 272600 1.3277 Brittany 190779 0.9720
8 Daniel 271734 1.3235 Elizabeth 172383 0.8783
9 Tyler 262218 1.2771 Taylor 168977 0.8609
10 Joseph 260365 1.2681 Megan 160312 0.8168
11 Brandon 259299 1.2629 Hannah 158647 0.8083
12 David 253193 1.2332 Kayla 155844 0.7940
13 James 244775 1.1922 Lauren 153530 0.7822
14 Ryan 241105 1.1743 Stephanie 149725 0.7628
15 John 239730 1.1676 Rachel 148907 0.7587
16 Zachary 225188 1.0968 Jennifer 147948 0.7538
17 Justin 220012 1.0716 Nicole 136033 0.6931
18 William 217588 1.0598 Alexis 131117 0.6680
19 Anthony 216088 1.0525 Victoria 117386 0.5981
20 Robert 205313 1.0000 Amber 115551 0.5887
In: Computer Science
Alan has a PAP with the following coverages: Liability
coverages: $100,000/$300,000/$50,000 Medical payments coverage:
$5,000 each person Uninsured motorists coverage: $25,000 each
person Collision loss: $250 deductible
Other-than-collision loss: $100 deductible
With respect to each of the following situations, indi- cate
whether the loss is covered and the amount pay- able, if any, under
the policy. Assume that each situation is a separate event.
a. Alan’s son, age 16, is driving a family car, runs a red light,
and kills a pedestrian. The family of the deceased pedestrian sues
and damages are awarded in the amount of $500,000.
b. Alan borrows a friend’s car to go to the supermar- ket. He fails
to stop at a red light and negligently smashes into another
motorist. The other driver’s car, valued at $15,000, is totally
destroyed. In addi- tion, repairs to the friend’s car are
$5,000.
c. Alan’sdaughter,Heather,attendscollegeinanother state and drives
a family auto. Heather lets her boy- friend drive the car, and he
negligently injures another motorist. The boyfriend is sued for
$50,000.
d. Alan’s wife is driving a family car in a snowstorm. She loses
control of the car on an icy street and smashes into the foundation
of a house. The prop- erty damage to the house is $30,000. The
damage to the family car is $8,000. Alan’s wife has medical
expenses of $5,000.
e. Alan is walking across a street and is struck by a motorist who
fails to stop. He has bodily injuries in the amount of $15,000.
f. Alan’s car is being repaired for faulty brakes. While road testing the car, a mechanic injures another motorist and is sued for $50,000.
g. Alan’s car hits a cow crossing a highway. The cost of repairing the car is $2,500.
h. Athiefbreaksacarwindowandstealsacameraand golf clubs locked in the car. It will cost $400 to replace the damaged window. The stolen property is valued at $500.
i. Alan’s wife goes shopping at a supermarket. When she returns, she finds that the left rear fender has been damaged by another driver who did not leave a name. The cost of repairing the car is $2,000.
j. Alan works for a construction company. While driv- ing a large cement truck, he negligently injures another motorist. The injured motorist sues Alan for $25,000.
k. Alan’s son drives a family car on a date. He gets drunk, so his girlfriend drives him home. The girl- friend negligently injures another motorist, who has bodily injuries in the amount of $200,000.
l. Compact discs (CDs) valued at $500 are stolen from Alan’s car. The car was locked when the theft occurred. m. While driving a rented golf cart, Alan accidentally injures another golfer with the cart.
In: Operations Management
In December 2017, 9-year old Jack and his mother (Harriet) were visiting their extended family in Melbourne. They were shopping in the city on 21 December when a driver drove his car into pedestrians at the corner of Flinders and Elizabeth streets. Jack and his mum witnessed this event (in which 18 people were injured, with an elderly man subsequently dying from his injuries). They were not in harm’s way (with the car traveling away from them and the driver quickly apprehended. However, Jack and his mum had multiple conversations about how they each thought they could have been killed during the attack. Two days later, Jack and his mum returned to their home in Brisbane.
Jack lives in an intact family consisting of his biological parents, Harriet and Peter, and his older sister Natalie. He is in Grade 4 at the local primary school and has lots of friends. He is also close to his parents and his grandparents (who are involved in his care during the week).
Immediately following his return home, Jack experienced nightmares on a few occasions about cars driving towards him. After the first nightmare, Jack’s dad (who has a history of anxiety and depression) encouraged Jack to sleep in the parents’ bedroom on a camp mattress. Despite mum’s suggestion that it is time for Jack to move back to his own bedroom, he is still sleeping in his parents’ room. Jack’s mum and dad have had many arguments about this situation. Peter’s (dad) perspective is that:
Jack is a very sensitive child who (even as a newborn baby) is more easily upset than other children;
Jack has been exposed to a traumatic experience in which he could have been killed;
Loving support (including avoidance of going into Brisbane city) is required to prevent Jack from developing ongoing mental health problems following this exposure; and
He (dad) could not cope if he lost one of his children.
From Harriet’s (mum) perspective:
The experience was upsetting but she and Jack were not hurt and were never likely to have been hurt (as she has discussed with Jack);
Peter (dad) needs to talk about the attack less; and
Jack is a healthy boy who seems to be handling the experience well.
Question: How likely do you think it is that Jack might develop a diagnosable mental health problem following his exposure to the attack in Melbourne? [Note, you are not being asked to identify possible mental health problems]. Identify 8 factors (a mixture of risk and protective factors – does not need to be 4 of each, but rather 8 in total) to justify your answer, and explain why each is either a risk or a protective factor.
In: Psychology
Background: In December 2017, 9-year old Jack and his mother (Harriet) were visiting their extended family in Melbourne. They were shopping in the city on 21 December when a driver drove his car into pedestrians at the corner of Flinders and Elizabeth streets. Jack and his mum witnessed this event (in which 18 people were injured, with an elderly man subsequently dying from his injuries). They were not in harm’s way (with the car travelling away from them and the driver quickly apprehended. However, Jack and his mum had multiple conversations about how they each thought they could have been killed during the attack. Two days later, Jack and his mum returned to their home in Brisbane.
Jack lives in an intact family consisting of his biological parents, Harriet and Peter, and his older sister Natalie. He is in Grade 4 at the local primary school and has lots of friends. He is also close to his parents and his grandparents (who are involved in his care during the week).
Immediately following his return home, Jack experienced nightmares on a few occasions about cars driving towards him. After the first nightmare, Jack’s dad (who has a history of anxiety and depression) encouraged Jack to sleep in the parents’ bedroom on a camp mattress. Despite mum’s suggestion that it is time for Jack to move back to his own bedroom, he is still sleeping in his parents’ room. Jack’s mum and dad have had many arguments about this situation. Peter’s (dad) perspective is that:
Jack is a very sensitive child who (even as a newborn baby) is more easily upset than other children;
Jack has been exposed to a traumatic experience in which he could have been killed;
Loving support (including avoidance of going into Brisbane city) is required to prevent Jack from developing ongoing mental health problems following this exposure; and
He (dad) could not cope if he lost one of his children.
From Harriet’s (mum) perspective:
The experience was upsetting but she and Jack were not hurt and were never likely to have been hurt (as she has discussed with Jack);
Peter (dad) needs to talk about the attack less; and
Jack is a healthy boy who seems to be handling the experience well.
Question: How likely do you think it is that Jack might develop a diagnosable mental health problem following his exposure to the attack in Melbourne? [Note, you are not being asked to identify possible mental health problems]. Identify 8 factors (a mixture of risk and protective factors – does not need to be 4 of each; but rather 8 in total) to justify your answer, and explain why each is either a risk or a protective factor.
In: Psychology
Two scenarios are provided for the candidates. The candidates can provide appropriate solutions for any one or both the scenarios considering all the points.
Scenario 1:
An environment is attacked by zero-day attack with users identifying a notepad with attacker details and instructions to regain access, 60% of estate/users are impacted. Every endpoint had AV & EDR tools, but the machines were infected. Environment had required security controls for network, firewall, log monitoring, nothing was detected in SIEM. Backup strategy used is snapshot back-up on the same network in the same domain.
Using threat hunting techniques can we establish how hacker could have infiltrate and,
Scenario 2:
When looking at any security team, one thing you might notice is that there is a tool for everything. And we do mean everything: ticketing, threat intelligence, security investigations, malware analysis, detection, incident response, advanced persistent threats, security monitoring the list goes on.
Every organization wants the best of the best to build their defenses. This can often leave their security teams and security operations centers with a tool stack of uncooperative solutions that don’t communicate with one another, with their full value remaining untapped, and they can interrupt or even cancel each other out. The team becomes paralyzed by the sheer number of alerts generated by these solutions, losing time that could be spent on contextualized investigation and response.
We often cite alert fatigue as a common challenge in SOCs, and with good reason. Nobody likes alerts, because whether it’s a fire alarm, car alarm, or alarm for any other kind of emergency, it signals to us that a real threat is present. But after hearing alerts time and time again, all we hear is the boy who cried wolf. We downplay these alerts because we’ve spent so much of our precious time combing through them, only to reveal themselves as fake. In SOC terms, this leads to real threats being missed, often to devastating consequences.
There is a solution. That solution is connecting the tools that security teams run, to communicate with each other and do away with the tedious, time-consuming tasks that have a high potential for human error. Streamlining the process with which tools are used helps to keep security professionals from losing any of their precious time.
In: Computer Science
A chemical plant employing 850 employees (employees work a regular 40-hour work week) has the following safety and health records for the year 2016:
(a) File 1 Forklift truck drops pallet load of packaged raw material; no injuries; some material wasted; pallet destroyed; extensive cleanup required.
(b) File 2 Worker suffers heat cramps (illness) from continuous exposure to hot process; admitted to hospital for treatment: 2 weeks off.
(c) File 3 Worker burns hand on steam pipe; first aid received and worker returns to workstation.
(d) File 4 Worker suffers dermatitis from repeated contact with solvent; 1 week of work lost; another 4 weeks of work restricted to an assembly job.
(e) File 5 Worker fractures finger in packaging machine; worker sent to hospital for treatment; back on the job the next day.
(f) File 6 Maintenance worker lacerates hand when screwdriver slips; five sutures given; worker back on the job the next day.
(g) File 7 Pressure vessel explodes; extensive damage to processing area; miraculously, no one is injured.
(h) File 8 Worker gets poison ivy from exposure a week earlier while removing weeds around the plant perimeter fence; worker receives doctor’s treatment, but no workdays are lost.
(i) File 9 Worker becomes ill from continuous exposure to hydrogen sulfide leaks from furnace area; misses 2 weeks’ work; leaks are repaired.
(j) File 10 Worker gets severe poison ivy from weekend outing with Boy Scout troop; misses 2 days of work.
(k) File 11 Maintenance worker falls from fractionating tower and is killed.
(l) File 12 Worker fractures an arm in transmission system that powers pulverizer mill; loses 3 days of work and an additional 6 weeks of work is in the production scheduling office before returning to regular job. 2
(a) Fill this data into an OSHA 300 log and complete totals column
(b) Calculate the following incidence rates: 1. LWDI 2. Total injury incidence rate 3. Total illness incidence rate 4. Fatality incidence rate 5. Number-of-lost-workdays rate (injuries and illnesses) 6. Specific-hazard incidence rate (fractures)
(c) Based on National Safety Council statistics for injury facts, how does the safety and health record of this firm compare with that of other manufacturing companies and with industries in general? If no data are available for year 2016, use data for year 2007 for comparison. (Text book on Page 25)
In: Mechanical Engineering
You have been asked to teach a fitness class at your local community center three mornings a week. The community center weight room has 4 squat/press racks, bars, bumper plates, dumbbells and kettlebells in a range of sizes, 4 TRX units, cones, jump ropes, and a large open indoor space as well as an outdoor courtyard. You may bring in any additional equipment you would like.
Design a four-week cycle of classes in which you develop strength, endurance, and cardiovascular fitness in three classes per week. Provide scaling options for the different experience and fitness levels in each class. Develop this case study as you see fit, including defining your audience, describing what equipment and training style you will use, and explaining how you would deal with potential problems.
Include exercises and modifications for all four weeks, as well as a narrative of how you will set up your class and the necessary considerations. Use the template provided to design your case study.
Some questions that will help you design your class:
In: Biology
For mallard ducks and Canada geese, what percentage of nests are successful (at least one offspring survives)? Studies in Montana, Illinois, Wyoming, Utah, and California give the following percentages of successful nests (Reference: The Wildlife Society Press, Washington, D.C.).
| x: Percentage success for mallard duck nests | ||||
| 86 | 53 | 86 | 44 | 32 |
| y: Percentage success for Canada goose nests | ||||
| 63 | 60 | 57 | 30 | 24 |
(a) Use a calculator to verify that Σx = 301; Σx2 = 20,561; Σy = 234; and Σy2 = 12,294.
| Σx | Σx2 | ||
| Σy | Σy2 |
(b) Use the results of part (a) to compute the sample mean,
variance, and standard deviation for x, the percent of
successful mallard nests. (Round your answers to two decimal
places.)
| x | |
| s2 | |
| s |
(c) Use the results of part (a) to compute the sample mean,
variance, and standard deviation for y, the percent of
successful Canada goose nests. (Round your answers to two decimal
places.)
| y | |
| s2 | |
| s |
(d) Use the results of parts (b) and (c) to compute the coefficient
of variation for successful mallard nests and Canada goose nests.
(Round your answers to one decimal place.)
| x | y | |
| CV | % | % |
Write a brief explanation of the meaning of these numbers. What do
these results say about the nesting success rates for mallards
compared to Canada geese?
a. The CV is the ratio of the standard deviation to the mean; the CV for Canada goose nests is higher.
b. The CV is the ratio of the standard deviation to the mean; the CV for Canada goose nests is equal to the CV for mallard nests.
c. The CV is the ratio of the standard deviation to the mean; the CV for mallard nests is higher.
d. The CV is the ratio of the standard deviation to the variance; the CV for Canada goose nests is higher.
e. The CV is the ratio of the standard deviation to the variance; the CV for Canada goose nests is equal to the CV for mallard nests.
g. The CV is the ratio of the standard deviation to the variance; the CV for mallard nests is higher.
Would you say one group of data is more or less consistent than the
other? Explain.
a. The x data group is more consistent because the standard deviation is smaller.
b. The two groups are equally consistent because the standard deviations are equal.
c. The y data group is more consistent because the standard deviation is smaller.
In: Statistics and Probability
Not more than 250 words for each Question ,
1.Let’s say you are running a pet store (similar to Pet Co. but instead we’ll call it Pet Inc.). Right now you just have a retail business aimed at selling typical household pet products like dog food and cat litter etc. What is an area of value-generating diversification you can expand into? Be specific as to why you think this is value-generating. What could be an example of a value-destroying area of diversification?
2.In 2008, Under Armour introduced their first athletic shoe in an attempt to capture some of the athletic footwear market. Until this point, UA primarily manufactured and sold sports apparel. Two weeks before the scheduled release of UA’s shoe, Nike responded by releasing a similar shoe at a price point $10 cheaper. Given what you know about competitive dynamics, how could you have predicted that Nike would respond so quickly and aggressively?
3.Three elements to this question. Choose a business with which you are familiar. First, briefly describe its business level strategy. Then describe the business’ primary value chain? Finally, what are one or two distinct activities at each section of the value chain that support the overarching business-level strategy?
4.Suppose in your town there is only one hairstylist that usually charges around $60 for a woman’s haircut. While that is a bit above average in price, the business has great reviews because the stylists are well-trained, are very creative, and they have great customer service. After doing some market research you determine that there is room in the market for another styling shop in the area. How would you compete with this other shop? Meaning, what would your business-level strategy be? Try to be specific and highlight the factors that drive your chosen strategy.
5. There have been a lot of interesting stories lately in the business press about the US retail industry. Most analysts agree that the industry has experienced significant changes. Think about what the industry might have been like about 20 years ago (~year 2000) versus how it is now. How do you feel the industry has changed in relation to Porter’s Five Forces?
In: Economics
Run the Python Queue Line Simulator three times
Python Queue Line
"""
File: pyQueueSim.py
Author: JD
"""
import random
print("Queue as a customer line\n")
queue = [] # Empty que
y = int(0)
# Queue up some customers
for i in range(1,20):
x = random.randint(1, 20)
if x >= 2 and x<= 8:
queue.append(x) # Add to the front
# Simulate cumstomer line processing
while True:
x = random.randint(1, 20)
if x >= 2 and x<= 8:
queue.append(x *2) # Add to the front
print("Queued :", x)
elif x >=9 and x <=14 and len(queue)>0:
y = queue.pop(0)
print ("Removed: ",y)
elif x == 17 and len(queue)>=10:
print ("Line closing\n")
while len(queue)>0:
y =
queue.pop(0)
print ("Removed: ",y)
break
Queue as a customer line
Queued : 3
Removed: 8
Queued : 7
Queued : 4
Removed: 7
Removed: 6
Removed: 7
Removed: 2
Removed: 2
Removed: 5
Queued : 4
Removed: 4
Queued : 3
Removed: 7
Removed: 6
Queued : 6
Removed: 14
Queued : 5
Removed: 8
Removed: 8
Removed: 6
Queued : 3
Queued : 5
Removed: 12
Queued : 4
Queued : 3
Queued : 3
Queued : 4
Queued : 4
Queued : 5
Queued : 6
Removed: 10
Removed: 6
Queued : 4
Queued : 5
Removed: 10
Removed: 8
Removed: 6
Removed: 6
Removed: 8
Queued : 4
Queued : 8
Queued : 2
Removed: 8
Queued : 8
Queued : 3
Queued : 8
Queued : 7
Removed: 10
Queued : 6
Removed: 12
Removed: 8
Queued : 8
Queued : 8
Queued : 4
Removed: 10
Queued : 4
Removed: 8
Removed: 16
Queued : 5
Removed: 4
Queued : 2
Queued : 2
Queued : 5
Removed: 16
Queued : 4
Line closing
Removed: 6
Removed: 16
Removed: 14
Removed: 12
Removed: 16
Removed: 16
Removed: 8
Removed: 8
Removed: 10
Removed: 4
Removed: 4
Removed: 10
Removed: 8
Press any key to continue . . .
IN PYTHON THANKS
In: Computer Science