Write a program that reads words from a text file and displays all the words (duplicates allowed) in ascending alphabetical order. The words must start with a letter. The text file is passed as command-line argument (you can assume that the text file is in the same directory as the executable, i.e. bin).
Q: It should be made clear what the differences are between FDM and TDM. Could you please give me a…
A: Multiplexing is the technique of combining multiple signals or data streams into a single signal or…
Q: Provide an overview of the numerous diverse methods that may be used to hide data, since each of…
A: Law enforcement organisations are created to stop and lessen crime in every nation. With the…
Q: What kinds of approaches does MDM use for database management?
A: MDM fundamentally employs three techniques: Identity Register: This solution maintains master data…
Q: Log in to ranger using your class account (refer to previous labs if you have questions about how to…
A: Answer: Algorithms: Step1: we have ask to user to given the length if rectangle 1 Step2: we have…
Q: What are the three most important characteristics of a functional network? Just what are the three…
A: As a network, consider the following three characteristics to be essential to my operation and…
Q: How can you tell if something you see on social media is real or fake?
A: Fake news is misinformation disguised as news. Deliberately fabricated tales, which the authors know…
Q: We'll utilise Don Norman's concept of user issues to examine how formative assessment might address…
A: The biggest usability obstacle was the ubiquity of outstanding design. Most projects were led by…
Q: Explain how to add functionality to a Button on a Form in C#
A: C# (pronounced "see sharp") is a modern, object-oriented programming language developed by Microsoft…
Q: Have you thought about what the word "technology" means to yo
A: Introduction: The word "technology" has become ubiquitous in our modern world, often used to refer…
Q: What exactly is the software project manager responsible for?
A: Computer science has a subset called software engineering that focuses on the design and…
Q: What, in your view, are the components that make up "critical infrastructure"? There should be three…
A: The answer is given in the below step
Q: What kind of action should be taken in view of the current issue with the cyber security of…
A: 1) The cyber security breach at iPremier was a significant incident in the early days of e-commerce.…
Q: Think about what important features your operating system would need to have if you were to make…
A: Every computer system's foundation is its operating system. Several apps should be included in the…
Q: Audits and responsibility may help refine the layout of an information technology system. If at all…
A: An audit is a systematic examination of an organization's financial, operational, or technical…
Q: the software configuration management proces
A: Introduction: Software configuration management (SCM) is defined as the process of keeping the track…
Q: Do you have any experience with what is referred to as "information technology"?
A: Information technology (IT) is a term used to describe the application of computer and…
Q: For the sake of this layer, we refer to it as the "intermediary," and it is in charge of ensuring…
A: Given: The layer positioned between the database and the client servers is referred to as the…
Q: What are the advantages of using several forms of authentication? What part does it play in…
A: Answer: Authentication is basically a process to make the data or system of the organization / user…
Q: 1.46 Prove that the following languages are not regular. You may use the pumping lemma and the…
A: Note: Since you have posted multiple questions, we will provide the solution only to the first…
Q: When these three conditions are met, and only then, can a network be considered effective and…
A: According to the inquiry network, considerable aid may be provided when one has the ability to act…
Q: Do you plan to do anything to make the following URLs (hyperlinks) more secure?
A: Answer: Introduction Unified Resource locator responsible for the given unique resource on the web.…
Q: In the context of artificial intelligence, what exactly do you mean when you refer to "deep…
A: Deep learning is a subset of machine learning that uses neural networks with multiple layers to…
Q: By doing research on the Internet, you may learn about the most recent advancements in wireless…
A: A wireless LAN (WLAN) creates a local area network by wirelessly connecting two or more devices in a…
Q: Does having a disability affect your ability to use the internet? How do you see people with…
A: The way we interact, work, and obtain information has been changed by technology. Nonetheless, using…
Q: If that's the case, how up to date are you on the most recent security protocols for networks? I…
A: Introduction: In today's digital age, network security is of utmost importance. With the increasing…
Q: Using a modern-day health band, this M2M illustration demonstrates the benefits of a loT-based…
A: M2M (Machine-to-Machine) and IoT (Internet of Things) are related concepts, but they are not exactly…
Q: It is important to have an in-depth conversation about the benefits and applications of…
A: Usefulness of Convolutional Neural Networks CNN's main advantage over its forerunners is that it can…
Q: Layer-1 WAN. Discuss PSTN features, pros, cons, and use cases.
A: WAN technology on the Layer 1 level: The capabilities of a LAN are used by a WAN. WANs are used to…
Q: How does he convey the significance of having a robust cyber defence against more sophisticated…
A: Having a robust cyber defense is essential in today's digital age, as cyber threats become…
Q: What are the main differences between computers that are "embedded" and those that are…
A: Introduction: An embedded system is one in which the computer (often a microcontroller or…
Q: Create a domain model for the conference review system described below: For an international…
A: A domain model is a conceptual model of the relationships between the key concepts and entities…
Q: need help complete the implementation for TaskMenu.h and TaskMenu.cpp please help me
A: In this question we have to implement and define the TaskMenu.h and TaskMenu.cpp Let's code and hope…
Q: Experts in the field of information security are critical of companies because they fail to keep…
A: 1) Information security refers to the practice of protecting sensitive and confidential information…
Q: How can network devices prevent packet loss when a router fails? TCP/role IP packet switching…
A: Introduction Data is transmitted over a network utilizing TCP/IP (Transmission Control…
Q: As an illustration of the possibilities and benefits of an IoT-oriented approach through M2M, think…
A: IoT- Internet of Things is the aggregate network of associated devices and the innovation that works…
Q: Is it beneficial for us as individuals, for our families, and for our society that information and…
A: Introduction: In today's information age, we are constantly bombarded with a vast amount of…
Q: For a network to be effective and productive, what three characteristics are necessary? Tell me…
A: Intro The following are some of the most important characteristics that a network should have: 1.…
Q: What are the top three characteristics of an effective network? Which three characteristics make up…
A: Given: We have to discuss What are the top three characteristics of an effective network .Which…
Q: While selecting a solution for the protection of a physical network, what factors should be taken…
A: Introduction: The protection of physical networks is a crucial aspect of maintaining IT security.…
Q: Provide an overview of the many different techniques of data concealment that present substantial…
A: By definition, law enforcement is an information-intensive endeavour. There are three distinct sorts…
Q: reasonable to expect that a circularly-linked list solution for queues implemented in C++ would have…
A: A circularly-linked list solution for queues implemented in C++ can have some benefits over a…
Q: Is it possible that using multifactor authentication in conjunction with two-factor authentication…
A: Yes, using multifactor authentication (MFA) in conjunction with two-factor authentication (2FA) can…
Q: Discover the effects that wireless networks have on nations with a low standard of living. There are…
A: The impact of wireless networks on nations experiencing a lower standard of living is a crucial…
Q: The following are the three most important aspects of every functional network: Let's break them…
A: Introduction: A functional network is an essential component of modern communication and information…
Q: What exactly are these knowledge-based systems, and what applications do they have?
A: Although knowledge-based programs excel at tackling several forms of coordinating innovation, this…
Q: 4. A Mersenne prime is a prime number that is equal to 2"-1, where n is an integer. (Example: 31 =…
A: MATLAB is a programming and numeric computing platform that is widely used by engineers and…
Q: Describe how the Web works by identifying and explaining the role of its key components
A: The web is a vast network of interconnected web pages that are accessed using the internet.
Q: For a network to be effective and productive, what three characteristics are necessary? Tell me…
A: Answer: Instruction Successful network might be company internal support network reliable so that…
Q: What does the abbreviation RGB really stand for?
A: RGB stands for "Red, Green, Blue." It is a color model used in digital imaging and computer graphics…
Q: Managing software development initiatives is different.
A: Introduction: Software development initiatives are complex projects that require careful planning…
Can you help/guide me on this assignment, here are the directions:
Write a program that reads words from a text file and displays all the words (duplicates allowed) in ascending alphabetical order. The words must start with a letter. The text file is passed as command-line argument (you can assume that the text file is in the same directory as the executable, i.e. bin).
I think the code is correct but I believe what I'm doing wrong is the Command line argument where I'm placing the text file. Which I think is in the right place, apparently not.
Here's my work:
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images
- package Q2;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.util.ArrayList;import java.util.Scanner;public class Question2 {public static void main(String[] args) throws FileNotFoundException {/*** Part a* Finish creating an ArrayList called NameList that stores the names in the file Names.txt.*/ArrayList<String> NameList = new ArrayList<String>();/*** Part b* Replace null on the right-hand-side of the declaration of the FileInputStream object named inputStream* so that it is initialized correctly to the Names.txt file located in the folder specified in the question description*/FileInputStream inputStream = new FileInputStream("Names.txt");Scanner scnr = new Scanner(inputStream); //Do not modify this line of code/*** Part c* Using a loop and the Scanner object provided, read the names from Names.txt* and store them in NameList created in Part a.*/while (scnr.hasNext()) {//reading each string from text file and adding to…Java code Consider the interface below:package prelim;import java.util.NoSuchElementException;public interface MyList<E> { public int getSize(); public void insert(E data) throws ListOverflowException; public E getElement(E data) throws NoSuchElementException; public boolean delete(E data); // returns false if the data is not deleted in the list public boolean search(E data); // returns index of data, else -1 is returnCreate implementations of the above interface in different ways as stipulated below.Use an array object to store the elements of the list object. This array object will have a fixed size of five (5) and that an attempt to insert an element into the array when full will result to a ListOverflowException.Java. Reference attachment. Starter code below. public class Pig {private int age;private int weight; public Pig(int age, int weight) {this.age = age;this.weight = weight;} public int getAge() {return age;} @Overridepublic String toString() {return String.format("Age: %d, weight: %d kg", age, weight);} } //Do not modify this file. import java.util.ArrayList;import java.util.Collections; public class PigsPigsPigs {public static void main(String[] args) {ArrayList<Pig> fatPigs = new ArrayList<>();fatPigs.add(new Pig(4,300));fatPigs.add(new Pig(6,278));fatPigs.add(new Pig(4,100));fatPigs.add(new Pig(3,500));fatPigs.add(new Pig(6,5000));fatPigs.add(new Pig(1,20));fatPigs.add(new Pig(1,500));fatPigs.add(new Pig(8,500)); Collections.sort(fatPigs); for (Pig pig: fatPigs) {System.out.println(pig);} }}
- public class ShoppingListDriver{ public static void main(String[] args){ ShoppingList sl=new ShoppingList(3);sl.insert(null);sl.insert(new Item("Bread", "Carb Food", 2, 2.99));sl.insert(new Item("Seafood","Sea Food", -1, 10.99));sl.insert(new Item("Rice", "Carb Food",2, 19.99));sl.insert(new Item("Salad Dressings","Dessing", 2, 19.99));sl.insert(new Item("Eggs", "Protein",2, 3.99));sl.insert(new Item("Cheese","Protein", 2, 1.59));sl.insert(new Item("Eggs", "Protein",3, 3.99));sl.printNames();sl.print(); System.out.println("After removing Eggs:");sl.remove(new Item("Eggs","Protein",0,0));sl.printNames();sl.print(); }}Java Program: There are errors in the lexer and shank file. Please fix those errors and there must be no error in any of the code at all. Below is the lexer, shank, and token files. The shank file is the main method. There is a rubric attached as well. Lexer.java import java.util.ArrayList;import java.util.HashMap;import java.util.List; import mypack.Token.TokenType; public class Lexer { private static final int INTEGER_STATE = 1;private static final int DECIMAL_STATE = 2;private static final int IDENTIFIER_STATE = 3;private static final int SYMBOL_STATE = 4;private static final int ERROR_STATE = 5;private static final int STRING_STATE = 6;private static final int CHAR_STATE = 7;private static final int COMMENT_STATE = 8; private static final char EOF = (char) -1; private static String input;private static int index;private static char currentChar;private static int lineNumber = 1;private static int indentLevel = 0;private static int lastIndentLevel = 0; private static…Java Program ASAP Here is a FileSorting program to read a CSV file, sorts a list of integers on each row, and prints a comma separated list of sorted integers on the console. Modify ir by removing or changing the main method os it passes all the test cases. import java.io.File;import java.io.FileNotFoundException;import java.util.ArrayList;import java.util.Scanner; public class FileSorting { private static final String FILENAME = "somefile.txt"; public static void main(String[] args) { // read integers from input file Scanner fileReader; ArrayList<Integer> numbers = new ArrayList<>(); try { fileReader = new Scanner(new File(FILENAME)); while(fileReader.hasNextLine()) { numbers.add(Integer.parseInt(fileReader.nextLine().trim())); } fileReader.close(); }catch(FileNotFoundException fnfe){ System.out.println("File " + FILENAME + " is not…
- JAVA PROGRAM ASAP Please modify this program ASAP BECAUSE the program down below does not pass all the test cases when I upload it to hypergrade. The program must pass the test case when uploaded to Hypergrade. import java.util.HashMap;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.Scanner;public class MorseEncoder { private static HashMap<Character, String> codeMappings = new HashMap<>(); public static void main(String[] args) { initializeMappings(); Scanner textScanner = new Scanner(System.in); System.out.println("Please enter a string to convert to Morse code::"); String textForEncoding = textScanner.nextLine().toUpperCase(); if ("ENTER".equals(textForEncoding)) { System.out.println(); return; } String encodedOutput = encodeText(textForEncoding); System.out.println(encodedOutput); } private static void initializeMappings() {…USING THE FOLLOWING METHOD SWAP CODE: import java.util.*; class ListIndexOutOfBoundsException extends IndexOutOfBoundsException { public ListIndexOutOfBoundsException(String s) { super(s); } } class ListUtil { public static int maxValue(List<Integer> aList) { if(aList == null || aList.size() == 0) { throw new IllegalArgumentException("List cannot be null or empty"); } int max = aList.get(0); for(int i = 1; i < aList.size(); i++) { if(aList.get(i) > max) { max = aList.get(i); } } return max; } public static void swap(List<Integer> aList, int i, int j) throws ListIndexOutOfBoundsException { if(aList == null) { throw new IllegalArgumentException("List cannot be null"); } if(i < 0 || i >= aList.size() || j < 0 || j >= aList.size()) { throw new ListIndexOutOfBoundsException("Index out…StringSorter.java is below: import java.io.*; // for Reader (and subclasses), Writer (and subclasses) and IOExceptionimport java.util.*; // for List, ArrayList, Iterator public class StringSorter { ArrayList lines; // given that we don't really know how to deal with a read/write error (IOException) // inside the functions, we'll let it pass through public void readFromStream(Reader r) throws IOException { BufferedReader br=new BufferedReader(r); lines=new ArrayList(); while(true) { String input=br.readLine(); if(input==null) break; lines.add(input); } } public void writeToStream(Writer w) throws IOException { PrintWriter pw=new PrintWriter(w); Iterator i=lines.iterator(); while(i.hasNext()) { pw.println((String)(i.next())); } } // returns the index of the largest element in the list static int findIdxBiggest(List l, int from, int to) { String…
- java quetion Write a generic AddressBook<E extends Person> class that manages a collection ofPerson objects. The AddressBook class is a generic class limited to person objects. Forexample, once you instantiate an AdressBook of Student objects, you cannot add anyother type of person objects into that instance of address book.The AddressBook should have methods to add, delete, or search for a Person objects inthe address book.• The add method should add a person object to the address book. Make sure thatthe add method does not add duplicate person objects to the address book.• The delete method should remove the specified person object from the addressbook.• The search method that searches the address book for a specified person andreturns the list of persons matching the specified criteria. The search can be doneeither by first name, last name, or person id.Write an AddressBookTester class to test your class.THE QUESTION IS ATTACHED: PLEASE AVOID USING import java.util.ArrayList; import java.util.HashMap; import java.util.Map; BECAUSE I HAVEN'T STUDIED THEM YET, YOU CAN USE 1D AND 2D ARRAYS. YOU ARE FREE TO USE import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; EFFECTIVELY USE LOOPS AND CONTROL STATEMENTS. TXT. FILE IS INCLUDED BELOW: MOVIE NAME, MOVIE YEAR, RATING AND GENRE. The Martian2015Adventure8.0Murder on the Orient Express2017Crime6.5X-Men: First Class2011Action7.7X-Men: Days of Future Past2014Action7.9This Means War2012Action6.3Godzilla vs. Kong2021Adventure6.5Black Widow2021Action7.5Zack Snyder's Justice League2021Action8.1The Ten Commandments1956Drama7.9The Father2020Drama8.3Nobody2021Crime7.5Promising Young Woman2020Crime7.5What Lies Below2020Horror4.4Shrine2021Horror5.1Bram Stoker's Dracula1992Horror7.4JAVA PROGRAM PLEASE MODIFY THIS PROGRAM SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES THE TEST CASE and take out the following from the program please: Boynames.txt is missing.\n Girlnames.txt is missing.\n Both data files are missing.\n THE TEST CASE DOES NOT ASK FOR IT. PLEASE REMOVE IT. I HAVE PROVIDED THE TEST CASE THAT FAILED AND THE INPUTS AS A SCREENSHOT. import java.io.*;import java.util.*;public class NameSearcher { private static Map<String, Integer> loadFileToMap(String filename) throws FileNotFoundException { Map<String, Integer> namesMap = new HashMap<>(); File file = new File(filename); if (!file.exists()) { throw new FileNotFoundException(filename); } try (Scanner scanner = new Scanner(file)) { int lineNumber = 1; while (scanner.hasNext()) { String line = scanner.next().trim().toLowerCase(); namesMap.put(line, lineNumber); lineNumber++;…