I am working on creating a Broadcast Receiver. I am extremely new to Android development and Java. I added my code at the bottom of this, but whenever I press the button the app crashes. I'm assuming something is wrong with connecting the broadcastIntent() function. If you could really focus on the first part that would be great!! I appreciate any help :)
Here are the directions from my professor:
public void broadcastIntent(View view){
Intent intent =
new Intent();
intent.setAction("my.CUSTOM_INTENT");
sendBroadcast(intent);
}
Toast.makeText(context, "Intent Detected.", Toast.LENGTH_LONG).show();
<intent-filter>
<action android:name="my.CUSTOM_INTENT"></action>
</intent-filter>
MORE DIFFICULT:
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
MY CODE:
<MainActivity>
package com.example.ica4_broadcast;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private Button mybutton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button mybutton = (Button) findViewById(R.id.mybutton);
}
private void broadcastIntent(View view) {
Intent intent = new Intent();
intent.setAction("my.CUSTOM_INTENT");
sendBroadcast(intent);
}
}
<activity_xml>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/mybutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="235dp"
android:layout_marginEnd="146dp"
android:layout_marginRight="146dp"
android:onClick="broadcastIntent"
android:text="Button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ica4_broadcast">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ICA4Broadcast">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".MyReceiver" android:exported="true">
<intent-filter>
<action android:name="my.CUSTOM_INTENT"/>
</intent-filter>
</receiver>
</application>
</manifest>
<MyReceiver>
package com.example.ica4_broadcast;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Intent Detected", Toast.LENGTH_LONG).show();
}
}In: Computer Science
Designing and implementing a C++ structure data type - Monthly Budget
Remember to use correct code formatting and documentation.
A student has established the following monthly budget:
Budget Categories Budgeted amount
-----------------------------------------------------
Housing $ 580.00
Utilities $ 150.00
Household Expenses $ 65.00
Transportation $ 50.00
Food $ 250.00
Medical $ 30.00
Insurance $ 100.00
Entertainment $ 150.00
Clothing $ 75.00
Miscellaneous $ 50.00
----------------------------------------------------
Write a program that declares a MonthlyBudget structure designed with member variables to hold each of these expense categories. The program should define two MonthlyBudget structure variables budget and spent. The first MonthlyBudget structure variable budget will contain (ie., be assigned) the budget figures given above. Pass this first structure >budget variable to a function displayBudget that will display the budget categories along with the budgeted amounts.
The second MonthlyBudget structure variable spent will be passed to another function getExpenses that should create a screen form that displays each category name and its budgeted amount, then positions the cursor next to it for the user to enter the amounts actually spent in each budget category during the past month.
Finally, the program should then pass both structure variables budget and spent to a function compareExpenses that displays a report indicating the amount over or under budget the student spent in each category, as well as the amount over or under for the entire monthly budget.
You may design your own user-input interface but you must use a structure and must implement the three functions listed above. The format of the monthly budgeted report should appear as similar as possible to the sample output shown below.
HINT: Use the setw and right manipulators to right-justify dollar value outputs in function compareExpenses.
INPUT VALIDATION: Do not accept negative values for the users actual expenditure inputs in function getExpenses.
A sample test run using the Code::Block IDE-CompilerHere is your monthly budget for YEAR 2020:
Housing $ 580
Utilities $ 150
Household $ 65
Transportation $ 50
Food $ 250
Medical $ 30
Insurance $ 100
Entertainment $ 150
Clothing $ 75
Miscellaneous $ 50
=================================================
Total Budgeted $ 1500
=================================================
Enter month of expenditure: March
Enter actual monthly expenditures for each budget category
Housing: $ 580
Utilities: $ 130
Household: $ 50
Transportation:$ 50
Food: $ 230
Medical: $ 30
Insurance: $ 100
Entertainment: $ 120
Clothing: $ -10
ERROR: You must enter a positive number.
Clothing: $ 100
Miscellaneous: $ 30
Budgeted Spent Difference
=================================================
Housing 580.00 580.00 0.00
Utilities 150.00 130.00 -20.00
Household 65.00 50.00 -15.00
Transportation 50.00 50.00 0.00
Food 250.00 230.00 -20.00
Medical 30.00 30.00 0.00
Insurance 100.00 100.00 0.00
Entertainment 150.00 120.00 -30.00
Clothing 75.00 100.00 25.00
Miscellaneous 50.00 30.00 -20.00
=================================================
Total 1500.00 1420.00 80.00
=================================================
Congratulations! You were $80.00 under budget in March 2020.
Process returned 0 (0x0) execution time : 104.850 s
Press any key to continue.
Please make sure to declare your struct above your function prototypes and include appropriate function documentation as needed. You may use pointers or constant reference parameters when passing the structure variables to the functions mentioned above. DO NOT use global variables.
In: Computer Science
Scenario
It is 2020, and General Foryota Company opens a plant in which to
build a new mass-produced hover-craft. This hover-craft will work
using E-85 Ethanol, will travel up to 200 mph, and will reduce
pollution worldwide at a rate of 10 percent per year. It is likely
that when all automobiles in the industrial world have been changed
over to hovercrafts, emission of greenhouse gasses may be so
reduced that global warming may end and air quality will become
completely refreshed.
However, the downside is that during the transition time, GFC's Hover-Vee (only available in red or black), will most likely put all transportation as we know it in major dissaray. Roadways will no longer be necessary, but new methods of controlling traffic will be required. Further, while the old version of cars are still being used, Hover-vee's will cause accidents, parking issues, and most likely class envy and warfare. The sticker price on the first two models will be about four times that of the average SUV (to about $200,000.) Even so, GFC's marketing futurists have let them know that they will be able to pre-sell their first three years of expected production, with a potential waiting list which will take between 15 and 20 years to fill.
The Chief Engineer (CE) of GFC commissions a study on potential liabilities for the Hover-vees. The preliminary result is that Hover-vees will likely kill or maim humans at an increased rate of double to triple over automobile travel because of collisions and crashes at high speeds -- projected annual death rates of 100,000 to 200,000. However, global warming will end, and the environment will flourish.
The U. S. Government gets wind of the plans. Congress begins to discuss the rules on who can own and operate Hover-vees. GFC's stock skyrockets. The Chief Engineer takes the results of the study to the Chief Legal Counsel (CLC), and together they agree to bury the study, going forward with the production plans. The Chief Project Manager (CPM), who has read the study and agreed to bury it, goes ahead and plans out the project for the company, with target dates and production deadlines.
Our class is a team of young lawyers, project managers, engineers, and congressional aides who are all part of the process of helping get this project off the ground. In fact, according to the first letter of your last name, you are the following team:
Somebody sent a secret copy of the report to you at your home address. It has no information in it at all, except for the report showing the proof of the increase in accidents and deaths. The report shows, on its face, that the CE, CLC, CPM, and your Congressional Representative have seen copies of this report. On the front there are these words typed in red: They knew — they buried this. Please save the world!
Each of you feel a very loyal tie to your boss and your company/country. You all have mortgages, and families to feed. It is likely if you blow the whistle on this report, you will lose your job and your livelihood. You're not even sure who wrote the study in your envelope or who actually sent it to you.
Address all of the following:
In: Operations Management
Grammar Exercises
35. Microsoft faces two major threats: piracy and patent lawsuits.
36. Bill Gates focuses on product development and strategy; Satya Nadella focuses on operations.
37. Bill Gates focuses on product development and strategy; on the other hand, Satya Nadella focuses on operations.
38. Microsoft’s American offices are in Redmond Washington, New York City, San Francisco , Birmingham Alabama, and Phoenix Arizona.
39. Cloud computing involves three possible platforms: software as-a-service (SaaS) platform-as-a-service (PaaS) and infrastructure-as-a-service (IaaS).
48. The recent story about Microsoft in The Wall Street Journal/“The Wall Street Journal” was called Microsoft’s Gamble on Cloud Computing/“Microsoft’s Gamble on Cloud
Computing.”
49. Bill Gates said that he’d like to see the phrase go bing it/“go bing it” replace the phrase go google it/“go google it.”
50. At the luncheon, his speech, titled The Road to the Future/“The Road to the Future,” laid out his vision for cloud computing over the next decade.
51. In 2013, 3/three Microsoft business divisions were combined.
52. Revenues for the last fiscal year were $62,484 million/$62,484,000,000.
53. Revenues rose 28 percent/28% over the past year.
54. Microsoft employs over 89 thousand/89,000 employees.
55. Microsoft has five/5 business divisions.
56. 5/Five Microsoft divisions make up the Microsoft corporation.
57. Microsoft lost money in 3/three of the 17/seventeen product groups.
62. Microsoft joined with Accenture to create Avanade, an IT consultancy. They/It specialize/s in connecting to consumers through online platforms such as social networks.
63. Neither Yahoo! nor Microsoft has/have increased its/their market share in the search engine market for the past five years.
64. Microsoft hold/s its/their annual shareholders meeting at the corporate headquarters.
65. Every new Microsoft employee should provide copies of his/her/their Social Security card/s at the orientation.
66. The manual about computer programming tips are/is on reserve at the corporate reading room.
67. Microsoft and its competitors in the technology industry is/are constantly changing.
68. Many of Google’s HR policies are aimed at eliciting/illiciting honest feedback.
69. The advice/advise on Microsoft’s Help menu is not helpful.
70. All employees should ensure/insure that their LinkedIn pages do not contain any content contrary to the Code of Conduct.
71. This decision affects/effects every aspect of our marketing strategy.
72. Their next step is to identify how to raise enough capital/capitol for the venture.
73. She told me that the two products contain complementary/complimentary features.
74. This search engine is much more reliable than/then Google’s.
75. Sundar Pichai, CEO/ceo of Google, says that Google is ahead of its competitors in the race to develop artificial intelligence capabilities."
76. We just hired her for a Senior Developer/senior developer position.
77. Google’s headquarters are located in Silicon Valley/silicon valley.
78. The headquarters are located just West/west of Sunnyvale.
79. Please contact Eileen Chao, Communications Lead/communications lead, for additional press inquires.
80. Ms. Chao explained, “We/we will invest more than $50 million this year to research and develop artificial intelligence.”
In: Operations Management
Patient Profile: Candace is a 23-year-old, G1P1, MWF, who delivered a 7 pound 8 ounce baby boy three weeks ago at the local birth center. She is very happy about the birth and is adjusting well to motherhood. She breastfed her baby a few minutes after the birth and has continued to exclusively breastfeed him. She intends to breastfeed for at least a year probably starting him on solid foods around six months. Prior to the pregnancy, Candace was a busy office executive in a local shipping firm. She is on a six-week leave of absence. She plans to pump her breast milk for the baby when she returns to work. She is hoping that her mother-in-law who will be caring for the baby, will be able to bring the baby to her workplace at least once a day at noon to breastfeed and then give the baby the breast milk she has left from a bottle for the other feedings. Her mother-in-law will be arriving from out of state in two weeks. Candace is a very “in control person.” She plans everything in her life, and up to this point the world has respected her wishes.
Case Study: Candace called the birth center this morning crying. Her breast on the left side is so sore she cannot stand to have the baby nurse on that side, and to make matters worse, that is the only side the baby will take. For the last 12 hours the baby seems to want to nurse all the time or just cries and sucks his fist. She feels sick, cannot get anything done at home and at 2 p.m. is still in her pajamas with last night’s dinner and this morning’s breakfast dishes still in the sink. She and her husband had an argument this morning and he left for work angry and overtired after getting no sleep all night from the baby crying. He just wants her to stop being so stubborn, since she obviously doesn’t have enough milk, and give the baby some formula. Her car has broken down and she has no other source of transportation. The nurse working at the birth center offers to make a home visit.
Questions:
1. Prior to arriving at the home, what problems does the nurse anticipate at this visit?
2. Make a list of the quesitons that the nruse will ask Candace at the home visit.
3. Make a list of the observations that need to be made at the home visit.
4. Explain the process of supply and demand as it aplies to breastfeeding and milk supply.
5. Why does it appear to Candace’s husband that Candace has lost her milk?
6. On arrival the nruse find that Candac’s left breast mipple is cracked and bleeding slightly. The nurse also notes that Candace has a fever of 101.2, seems lethargic, and has an area the size of a quarter on the underside of her right breast that is firm, red, and warm. Candace tells the nruse that she feels like she has the flu. What is Candace’s problem, what probably caused it and what is the nurs’es next action?
7. The CNM at the birth center calls in a prescription for ampicillin 500 mg po qid for 10 days. Candace starts crying and asks if this means she can no longer breastfeed. What is the nruse’s best response?
8. Outline a teaching plan to reduce the possibility of Candace having another mastitis infection.
9. Why did the baby only want to nurse on the left side?
10. How can the nurse help Candace get him to also nurse on the right side?
11. Where can the nurse refer Candace for support with her breastfeeding?
12. Candace plans to return to work in two weeks. Make a list of decisions and possible problems that she will have to work through during these next two weeks, and after she returns to work, to prepare her and the baby for this transition. Provide alternative suggestions for her to consider.
13. Identify three priority concepts for Candace and three goals for each concept.
In: Nursing
Discussion Topic: Minimum 250 words
Griffin is proud of his accomplishments as a college football player.
“I’ve worked for a long time to make it this far. I did all the hard work. In addition to training hard with my team when I was in high school, spending my summers at football camp, and working out in general in the weight room, I also kept my grades up and look what it got me—a college scholarship! Next step? The NFL!”
However, college football is also taking its toll.
“I’m up at 7 every morning, bacon and eggs and biscuits and gravy and a big glass of orange juice for breakfast, followed by morning classes. Then I lift weights and practice all afternoon, eat two foot-long subs, one for my first lunch, and one for my second lunch, ending with a study hall just for the team.”
When asked if he varies his menu, Griffin tilts his head and wrinkles his nose, looking up at the ceiling. “Well, breakfast varies, depending on whether they’ve got waffles or not. I like a stack of waffles; but lunch is generally the same. Sometimes I add chips or a big cookie. Dinner’s always different. Last night I had spaghetti.”
Griffin faced some challenges last season, including a knee injury.
“But that’s all done with now. My knee is fine. The coach lectured me about something called ‘stress fractures,’” he says, “but nothing has happened. He didn’t have to worry about me.”
The nutritionist’s nurse asks the big question: What brings Griffin here today?
“Playing college football has been a big shock,” Griffin says. “I push myself harder than I have ever done in my life. My body’s just under a lot of stress. I mean, in high school, you’re player number one. You get drafted to a good college team, though, and boy, you find you’re struggling not to be on the bottom. Here, everyone was the best player in his high school. So pressure and competition and training are extra tough.”
“Eating is different too. At home, my mom let me eat what I wanted when I wanted, as long as I took my turn doing the dishes,” he laughs. “But here, some of our senior teammates have been teaching us how to load carbs. Recently some weird stuff has been happening to me, so my coach said I should talk to a dietitian.”
In: Nursing
Which clients would be at risk for developing nonthrombocytopenic purpura? Select all that apply.
| A. |
Child adopted from India and displaying malaise, lethargy, and petechiae all over the body associated with suspected scurvy. |
|
| B. |
73-year-old client admitted with concussion that resulted from a fall |
|
| C. |
55-year-old client diagnosed with Cushing disease displaying bruises, weight gain with a buffalo hump, and "moon" face |
|
| D. |
15-year-old with insulin-dependent diabetes who has hypoglycemia and is displaying irritability with headaches and tachycardia |
|
| E. |
Pregnant mother experiencing headaches and proteinuria |
Misinterpreting her physician's instructions, a 69-year-old woman with a history of peripheral artery disease has been taking two 325 mg tablets of aspirin daily. How has this most likely affected her hemostatic status?
|
Irreversible acetylation of platelet cyclooxygenase activity has occurred. |
||
|
The client's prostaglandin TXA2 levels are abnormally high. |
||
|
She is at risk of developing secondary immune thrombocytopenic purpura (ITP). |
||
|
The binding of an antibody to platelet factor 4 produces immune complexes. |
A client visited his health care provider after finding an enlarged lymph node along the mediastinal border. The health care provider may be alerted to a possible diagnosis of Hodgkin lymphoma (HL) based on the client having which other clinical manifestations? Select all that apply.
| A. |
Yeast infection in the mouth |
|
| B. |
Night sweats |
|
| C. |
Unexplained pruritus |
|
| D. |
Joint swelling |
|
| E. |
Sore throat with pustules on tonsils. |
The nurse is caring for a client who develops a paroxysmal supraventricular tachycardia. Which medications should the nurse prepare to administer? Select all that apply.
| A. |
Adenosine |
|
| B. |
Diltiazem (Class IV) |
|
| C. |
Lidocaine (Class 1B) |
|
| D. |
Metoprolol (Class II) |
|
| E. |
Amiodarone (Class III) |
You note eosinophilia on the client's laboratory results. You should interview the client about a history of which conditions? Select all that apply.
| A. |
Asthma |
|
| B. |
Exposure to parasites |
|
| C. |
Allergic reactions |
|
| D. |
Viral infection |
|
| E. |
Bacterial infection |
A surgeon is explaining to the parents of a 6-year-old boy the rationale for the suggestion of removing the boy's spleen. Which teaching point would be most accurate?
| A. |
"We believe that your son's spleen is causing the destruction of many of his blood platelets, putting him at a bleeding risk." |
|
| B. |
"Your son's spleen is inappropriately destroying the platelets from his blood and needs to be removed." |
|
| C. |
"Your son's spleen is holding on to too many of his platelets so they're not available for clotting." |
|
| D. |
"We think that his spleen is inhibiting the production of platelets by his bone marrow." |
A 78-year-old male client has undergone a total knee replacement. He just doesn't feel like getting out of bed and moving around. After 3 days of staying in bed, the physical therapist encourages him to get out of bed to the chair for meals. He starts to complain of dizziness and lightheadedness. These symptoms are primarily caused by which pathophysiologic principle? Select all that apply.
| A. |
Client is experiencing a reduction in plasma volume. |
|
| B. |
Peripheral vasoconstriction mechanism has failed. |
|
| C. |
Client is so stressed that he is releasing too many endorphins. |
|
| D. |
Client is still bleeding from the surgical procedure. |
|
| E. |
Client has loss all of his muscle tone. |
From the current health histories, which client(s) is at risk for developing secondary forms of immune thrombocytopenic purpura (ITP)? Select all that apply.
| A. |
Female client in the first trimester reporting abdominal cramping |
|
| B. |
Middle-aged client scheduled for gastroscopy to confirm Helicobactor pylori |
|
| C. |
Former IV drug user recently diagnosed with hepatitis C virus |
|
| D. |
Older adult female undergoing testing for cause of joint discomfort |
|
| E. |
Adolescent admitted for facial burns when the "vape" (cigarette) exploded in the mouth |
In: Nursing
Medical Coding
1. This is a 25-year-old female status post assault. The patient sustained a C5 compression fracture. MRI scan showed compression with evidence of posterior ligamentous injury. The patient was subsequently set up for the surgical procedure. The procedure was described in detail, including the risks. The risks included but not limited to bleeding, infection, stroke, paralysis, death, cerebrospinal fluid (CSF) leak, loss of bladder and bowel control, hoarse voice, paralyzed vocal cord, death, and damage to adjacent nerves and tissues. The patient understood the risks. The patient also understood that bank bone instrumentation would be used and that the bank bone could collapse and the instrumentation could fail or break or the screws could pull out. The patient provided consent.
The patient was taken to the OR. The patient was induced. Endotracheal tube was placed. A Foley was placed. The patient was given preoperative antibiotics. The patient was placed in slight extension. The right neck was prepped and draped in the usual manner. A linear incision was made over the C5 vertebral body. The platysma was divided. Dissection was continued medial to the sternocleidomastoid to the prevertebralfascia. This was cauterized and divided. The longus colli was cauterized and elevated. The fracture was visualized. A spinal needle was used to verify location using fluoroscopy. The C5 vertebral body was drilled out. The bone was saved. The disks above and below were removed. The posterior longitudinal ligament was removed. The bone was quite collapsed and fragmented. Distraction pins were then packed with bone removed from the C5 vertebral body prior to implantation. A plate was then placed with screws in the C4 and C6 vertebral bodies. The locking screws were tightened. The wound was irrigated. Bleeding was helped with the bipolar. The retractors were removed. The incision was approximated with simple interruptedVicryl. The subcutaneous tissue was approximated and skin edges approximated subcuticularly. Steri-Strips were applied. A dressing was applied. The patient was placed back in an Aspen collar. The patient wasextubated and transferred to recovery.
QUESTION: The code reported for the anesthesiologist service was 00060-P3-AA
Is this correct?
True or False
What is the correct code?
2. INDICATIONS: The patient is a 9-year-old male brought to the emergency room by his father. He was helping his father hang a mirror in the bedroom when it fell and shattered. The boy suffered lacerations on his left hand and left leg.
PROCEDURE: The patient was placed on the table in supine position. Satisfactory anesthesia was obtained. The area was prepped, and attention to the deeper laceration of the left palm of the hand was rst. A layered repair was performed and the 5.1-cm laceration was closed successfully with sutures. The lacerations on the lower extremity, a 2-cm laceration on the left leg at the base of the patella and a 3-cm laceration on the left shin, were successfully closed with 4-0 Vicryl as well. The patient tolerated the procedures well and was transported to the recovery room.
QUESTION: The procedure codes reported are: 12040-LT, 12003-51-LT
Is this correct?
True or False
What is the correct code?
3. Pt is a 37-year-old female hurt during a waterskiing accident. She was performing in a ski show at Water World Adventure Park when she came off the ski jump ramp in the wrong angle and hit the water unevenly, twisting her knee. Her physician, Dr. Faslzone, ordered her to use a wheelchair for the next?6 weeks.
I delivered a standard wheelchair with fixed full-length arms and swing-away, detachable footrests to the patient’s home. I spent 20 minutes instructing the patient on the proper way to use the chair, transfer from the chair to standard furniture and back, and transfer to other function furniture, including the toilet and the bed. She was instructed on how to stop and start the chair with the least amount of strain on her upper extremities and how to apply the brakes. Patient stated she clearly understood all instructions.
DX: Torn meniscus, lateral, bucket-handle, left knee?
P: Patient given instruction booklet and technical support number
QUESTION: The principal diagnosis code reported for this encounter is: S83.252A
Is this correct?
True or False?
What is the correct code?
In: Nursing
Question: Can I get the code in Java for this assignment to compare? Please and thank you.
Can I get the code in Java for this assignment to
compare? Please and thank you.
Description
Write a Java program to read data from a text file (file name given
on command line), process the text file by performing the
following:
Print the total number of words in the file.
Print the total number of unique words (case
sensitive) in the file.
Print all words in ascending order without
duplication.
Print all line(s) with line number(s) of the file
where a specific phrase is found. You must prompt the user to enter
a specific phrase to search for. Under each output line indicate
the location(s) of the first character of the matched phrase (refer
to the Sample Ouput below).
After outputting results keep prompting user until the
user enters EINPUT.
You must enter a multi-line comment before EACH method declaration.
In the comment you must provide a small description of this method.
Follow the template below:
/**
* <write your description of method here>
* @param <parameter name here> <write description of
parameter is here>
* @return <write description of what is returned here>
*/
You must handle all Exceptions appropriately:
Must output an appropriate message.
Must put the program into a state in which the user can recover
from or exit if necessary.
There must be at a minimum the following methods:
Name: main
Description: The main method should do the following.
Retrieve the file name from the command line.
The program should exit if the file does not exist or if the file
name is not given on the command line. When exiting the program
should print the message “File does not exist.”
If the file exists the main method should call the processFile
method. Any data that is needed from the main method must be passed
to the processFile method via its parameters. See processFile
method below.
Name: processFile
Description: The processFile method should read the contents of the
file. The processFile method should print out the following:
Print the total number of words in the file.
Print the total number of unique words (case sensitive) in the
file.
Print all words in ascending order without duplication.
Once the information above is printed to the console the
processFile method should call the search method. Any data that is
needed from the processFile method must be passed to the search
method via its parameters.
Name: search
Description: The search method should prompt the user for a search
phrase. Given the search phrase the search method should search
each line in the file for the location of the phrase on each line.
If the search phrase is not found on a line then just go to the
next line. The search method must find every occurrence of the
phrase on a line. The search method should print the line number,
the line and the location of the search phrase (“use ^”). After all
lines have been searched the search method then prompts the user to
enter another search phrase. The search method does not exit until
the user enters the phrase EINPUT.
random.txt file
Her old collecting she considered discovered.
So at parties he warrant oh staying. Square new horses and put
better end.
Sincerity collected happiness do is contented.
Sigh ever way now many. Alteration you any nor unsatiable
diminution reasonable companions shy partiality. Leaf by left deal
mile oh if easy.
Added woman first get led joy not early jokes.
Are own design entire former get should.
Advantages boisterous day excellence boy. Out between our two
waiting wishing.
Pursuit he he garrets greater towards amiable so placing.
Nothing off how norland delight. Abode shy shade she hours forth
its use.
Up whole of fancy ye quiet do. Justice fortune no to is if winding
morning forming.
In: Computer Science
|
1. |
The ability of an English speaker to know the difference between "John hit the ball" and "the ball was hit by John" relies most heavily on the component of language called
|
||||||||||||||||
|
2. |
An individual has developed a program to teach English to children entering school who only speak Spanish. She did this by learning about the culture of the children and determining what training approaches worked best in that culture. This is an example of
|
||||||||||||||||
|
3. |
Which of the following is a major problem with using "wild children" such as the boy of Aveyron or even Genie to address the issue of the inherent nature of language?
|
||||||||||||||||
|
4. |
Chomsky revolutionized the study of language and language development by changing the focus from
|
||||||||||||||||
|
5. |
Which of the following goals would fit the focus of a domain-general cognitive approach to the study of language development?
|
||||||||||||||||
|
6. |
How would a constructivist such as Piaget explain language development?
|
||||||||||||||||
|
7. |
Which of the following findings would lend support to a language specific module in humans?
|
||||||||||||||||
|
8. |
Which of the following theories of language development would fit most best into the formalist view?
|
||||||||||||||||
|
9. |
How do the connectionists explain how a child learns to use the rules of language without acquiring the rules either explicitly or implicitly?
|
||||||||||||||||
|
10. |
You believe that language is acquired from the feedback an infant receives for making different sounds. Specifically, if an English-speaking infant makes English speech sounds they will be rewarded and not when they make sounds from other languages. Your views fit best into the framework called
|
||||||||||||||||
|
11. |
Which theoretical framework for language development would emphasize checking perceptual (e.g., hearing) and general cognitive (e.g., memory) abilities of a young child who manifests a problem with language?
|
||||||||||||||||
|
12. |
Which of the following methods of data collection would be the best approach if you wished to determine if children could learn the rules of language by attending to the speech inputted to them?
|
In: Psychology