required program java   Create a class called DuplicateCounter. Create an instance method called count that takes a single parameter called dataFile (representing the path to a text file) and uses a Map of Strings to count how many times each word occurs in dataFile. The counts should be stored in an instance variable called wordCounter. Create an instance method called write that takes a single parameter called outputFile (representing the path to a text file) and writes the contents of wordCounter to the file pointed to by outputFile. The output file should be overwritten if it already exists, and created if it does not exist. Create a separate class called Application that contains a main method which illustrates the use of DuplicateCounter by calling both the remove and write methods. Your input file must be called problem2.txt and your output file must be called unique_word_counts.txt.

Question

required program java

 

Create a class called DuplicateCounter. Create an instance method called count that takes a single parameter called dataFile (representing the path to a text file) and uses a Map of Strings to count how many times each word occurs in dataFile. The counts should be stored in an instance variable called wordCounter. Create an instance method called write that takes a single parameter called outputFile (representing the path to a text file) and writes the contents of wordCounter to the file pointed to by outputFile. The output file should be overwritten if it already exists, and created if it does not exist.

Create a separate class called Application that contains a main method which illustrates the use of DuplicateCounter by calling both the remove and write methods. Your input file must be called problem2.txt and your output file must be called unique_word_counts.txt.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Java

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: I need some help arranging these countries in a C++ program : China: 1,433,783,686 India: 1,366,417,...

A: Program Instructions:Declare two arrays and store values of countries and populations in each of the...

Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...

A: Following is the c++ program that takes start time and future time as input from user and finally pr...

Q: Download the attached CreateRandomNumbersFile.cpp file, open it in Dev C++, and then compile and run...

A: The given CreateRandomNumbersFile.cpp asks the user to enter last name and then creates a txt file c...

Q: Python 3.7.4 Open the file hostdata.txt for reading.

A: To open the file hostdata.txt for reading, the statement is: f=open('hostdata.txt','r')The following...

Q: EXPLAIN ALL STEPS: Convert the following assembly language instructions into hexadecimal machine lan...

A: Assembly Language: Assembly language is a low-level language. It is machine dependent language. Asse...

Q: Hey i need help with coding in c++  Q1 // with steps  Write a program that determines a student’s gr...

A: Approach for the program- 1)Import the essential headers.2)Define the main function.3)Declare the va...

Q: (Emirp) An emirp (prime spelled backward) is a nonpalindromic prime number whose reversal is also a ...

A: The Java program is written to display first 100 emrip numbers which are nonpalindromic numbers whos...

Q: I dont understand how theyre getting the answers to the output public class MysteryWho {public stati...

A: The output of the given program is:

Q: Brief paragraph needed: We know that the Pep/9 simulated hardware has 64K of memory. But, how is tha...

A: Pep/9 hardwareThe pep/9 hardware consists of three components that is disk, central processing unit ...

Q: this is for python

A: Program descriptionTwo lists are created one is a 3 x 3 list and the other 4 x 4 to demonstrate the ...

Q: Take the tax program from the last homework assignment and implement it using classes and objects in...

A: The name of the class is the Customer.The customer class has two variable income and tax.The setInco...

Q: 1.Write a program in C++ , to count the number of people in each of the following age groups: 0-16 (...

A: Following is the approach of the program to count the number of persons of different age groups:Decl...

Q: Why did  Cisco systems transition from a standalone access control system to an IP networked systems...

A: Standalone control systems:Basic access control systems.Used at a single location.Not networked with...

Q: Compare and contrast cache and virtual memory and give an example scenario where each can be applied...

A: Cache memory:-It is the memory, which is very nearest to the CPU, all recent instruction is stored i...

Q: What issues and problems are raised by the use ofunintegrated information systems?

A: Loss and failures associated with computers are major computer issues, leading to unnecessarily high...

Q: In C++ I need to compose a function that accepts an array of integer values as an argument and retur...

A: Program Instructions:Pass array to the function getSum().Use the reference of the array to get the s...

Q: Create a new Java application called "AtmSimDoLoop" (without the quotation marks) that simulates a s...

A: Following are the steps to create the java application AtmSimDoLoop that simulates the working of AT...

Q: Write a program that will present the user with a main menu of options which the user can choose fro...

A: Program:import java.util.Scanner;public class Main {publicstaticvoid main(String[] args) {char user_...

Q: An administrator has received a call indicating that some users are having difficulty logging on aft...

A: Domain Controller:Domain controller is a server computer on Microsoft servers.The purpose of domain ...

Q: Form boolean equations in POS and SOP forms from the truth table attached (PLEASE EXPLAIN ALL STEPS)...

A: The circuit diagrams that correspond to the following Boolean equations  drawed using an online tool...

Q: Using Java Eclipse do the following program: Design a class named Rectangle to represent a rectangle...

A: Program Instructions:Declare variables width and height.Create a default and parameterized construct...

Q: Find the truth table that describes the following circuit:

A: The gates involved in the given circuits are:AND gate between Y and X.XNOR gate between Y and ~Z whi...

Q: Using DeMorgan's Law, write an expression for the complement of F ifF(x,y,z) = xz' (xy + xz)+ xy'(wz...

A: DeMorgan’s law:The theorems of DeMorgan are basically two sets of rules or laws developed for AND, O...

Q: Python 3.7.4 Write the code to call the function named send_signal. There are no parameters for this...

A: To call the given function without parameter we need to write it as send_signal(). The following is ...

Q: Translate the following pseudocode for finding the minimum value from a set of inputs into a Java pr...

A: Java program to find the minimum valueimport java.util.Scanner; public class Program{     Public sta...

Q: Vectors Write three statements to print the first three elements of vector runTimes. Follow each wit...

A: Program DescriptionThe program prompts the user to input 5 numbers to populate the vectorIt tests th...

Q: Given a nested list named table, use nested loops to print each element in the nested list.  Each el...

A: Python program to all the elements in a nested listProgram IntroCreate a python program to print all...

Q: Hi, I am required to: Create an array of 100 integers using a random generator. ( 1 for loop) Provi...

A: The given java program will follow the following rubrics:Importing essential header files.Creating a...

Q: Write a program that displays the income tax due on taxable income entered by the user. Have the use...

A: The program that displays the income tax due on taxable income is created in java.In calTax() method...

Q: Create a new Python program (you choose the filename) that contains a main function and another func...

A: Programimport randomdef changelist(myList)middleLsit=myList[3:9]print"The size of the list is now ",...

Q: OF 2019 x + X PG Difference between two given ti https://moodle.oakland.edu/plug X fn Course: CSI-14...

A: Program in C to calculate the order price by entering number of books, price of a book, tax per book...

Q: What is the mantisa and exponent value if 6.75 represnt in 8 bit binary floating point

A: The mantissa and exponent value of 6.75 can be obtained by converting the given decimal number into ...

Q: Write a program (or modify the one written for Lab 2) that displays the following menu and prompts t...

A: Create a main method and declare all required variables (two variables for operations (+, -, *, /) a...

Q: What is the RAND Report? Why was it developed? What was published in the RAND Report R-609?Why was i...

A: RAND Report:RAND reports consist of findings from the profound research and objective analysis which...

Q: Which of the following diagrams do not contradict the current state of our knowledge about the compl...

A: P class problems can be solved in deterministic polynomial time. NP class can be verified in the pol...

Q: Evaluate cloud computing in relation to each of these four (4) criteria Dependable Manageable Adapta...

A: DescriptionEvaluating cloud computing in relation to the following four criteria’s:DependableDependa...

Q: What is a disaster recovery plan, and why is it important for the organization? How to evaluate the ...

A: Disaster recovery plan is a formal documentation that includes detailed instructions and structural ...

Q: In Python Use the Design Recipe to write a function,  print_histogram  that consumes a list of numbe...

A:  Programming Instructions: Define the function print_histogram which takes the list of integers as a...

Q: Use the Design Recipe to define a function remove_value that consumes a list and a value and returns...

A: Program: def remove_value(list, value):result = []for number inlist:if number != value:result.append...

Q: Preffered language is java. Will be compiled with intellij Problem 1 consists of multiple parts. You...

A: Since there are multiple questions and you have not specified which part needs to be answered, we ha...

Q: I am trying to write a java code to see if the number entered by the user is a factor of the random ...

A: The following source code will print whether a number is a factor of generated random number or not ...

Q: Please help me with this, I'm stuck...

A: The DFA is a 5- tuple {Q, ∑, q, F, δ}:Q = {q0, q1, q2, q3, q4}∑ = w | w is a string over {a, b} that...

Q: What folder contains group policy templates, logon/logoff scripts, and DFS synchronization data? Gro...

A: “System Volume (SYSVOL)” folder contains group policy templates, logon scripts, and Distributed File...

Q: write code in c++ to calculate f(0.006), wheref(x) = e−x − cos xln(x + 1)correctly to ten decimal pl...

A: Create a C++ program and include all required modules.Define a macro "e" with value 2.71828.Create a...

Q: in c++ Create a new file (in Dev C++)  In Lab 2, you created a menu for a simple calculator program...

A: This C++ calculator program contains following functions:displayMessage : It prints string message o...

Q: c. Outline an algorithm for finding the largest key in a B-tree.

A: B-tree is a data structure tree that sorts the data, allows insertion and deletion, searching, and s...

Q: c++ program to read file and output grades - file name is studentGrades.txt and the content is inclu...

A: Program Instructions:Comment the unused code and add necessary variables.Use a while and three inner...

Q: Python 3.7.4: Assume that C is a variable has been assigned a string value. Write an expression whos...

A: Since you have not specified what needs to be done in else part so we have included a print statemen...

Q: Write a program in Python that converts an improper fraction to a mixed number. The program should p...

A: Program:#Display the messageprint("Calculate Mixed Number")print("======================")print()#Pr...

Q: An uppercase character is a character whose ASCII value is between 65(A) and 90(Z). Write a C++ prog...

A: Following is the c++ program:For loop is used to from 0 to length of string to read every character ...