



Lab2C.java
/**
* Name:
* Course number:
* Section:
* This program reads a mailing list text file from disk and tells whether
* the email addresses are invalid. If the email address is valid, then
* it gives statistics about address and does some string manipulations
* and writes to another text file.
*/
package abc1;
import java.io.*;
public class Lab2C {
public static void main(String[] args) {
try {
File myfile = new File("src/abc1/Lab2A.txt"); //Creating file object representing text file
FileReader filereader = new FileReader(myfile); //creating a connection stream for chars that connects to text file
BufferedReader reader = new BufferedReader(filereader); //chain the FileReader to BufferedReader for efficiency
//For output file
File mynewfile = new File("src/abc1/howardBeeMailing.txt"); //creating new file
FileWriter filewriter = new FileWriter(mynewfile);
BufferedWriter writer = new BufferedWriter(filewriter);
String line = null;
while((line=reader.readLine())!=null) { //reading each line till end of file is found
boolean valid = false; //initializing validity of each line as false, then we will check
if(line.contains("@")) { //if email address contains @
valid = true;
System.out.println(line.trim().toLowerCase()); //remove space, print in lowercase
System.out.println("Length: " + line.length());
System.out.println("Characters before @: " + (line.indexOf('@'))); //calculating chars before @
System.out.println("Characters after @: " + (line.length()-line.indexOf('@')-1)); //calculating chars after @
//writing valid email addresses with @howardcc.edu to another fle
if(line.contains("dmilburn@howardcc.edu")) {
String str = line.trim().toUpperCase();
writer.write(str);
writer.write('\n');
}
else if(line.contains("howardcc.edu")) {
writer.write(line.trim());
writer.write('\n');
}
}
else { //if email address doesn't contain @
System.out.println(line + " - " + "Email address unreadable");
}
}
reader.close();
writer.close();
}
catch(Exception e){
e.printStackTrace();
}
}
}


Time taken to complete: 55 Mins
Most difficult part: Creating and accessing files.
Java2 Screenshot of the output required Put some comment This is the mailing text file for...
T-Mobile LTE 8:12 AM Back Assignment 14: Professional St.... Detail Submission Grade Assignment 14: Professional Status Due: Jul 30, 2018 at 11:59 PM Complete an essay about the current role, working environment, and people involved in your selected profession. Consider what your profession does, what the current status is (pay, demand, etc), where the profession functions (i.e., hospitals, clinics, offices, laboratories, etc.), and what the personality and demographic of the profession is (who works in that role) - This is...
Python Coding The script, `eparser.py`, should: 1. Open the file specified as the first argument to the script (see below) 2. Read the file one line at a time (i.e., for line in file--each line will be a separate email address) 3. Print (to the screen) a line that "interprets" the email address as described below 4. When finished, display the total number of email addresses and a count unique domain names Each email address will either be in the...
Lab 1.4: Arrays, File I/O and Method Review (40 pts) Assume you work for a company that received a list of email addresses of potential new customers from a data broker. Your company receives a file named customers.txt with the below information: Jiming Wu jwu@G.com James Brown Jaime.Boy.Brown@hotmail.com Leanna Perez LeaPerez@att.net Xing Li Xing.Li@sbcglobal.net Stacey Cahill SCahill@G.com Mohammed Abbas downtown_Abbas@yahoo.com Kumari Chakrabarti KukuChakrabarti@att.net Shakil Smith Shakattaq2G.com Jung Ahrin Jung_Ahrin@sbcglobal.net Pedro Martinez Pedro2018@sbcglobal.net Ally Gu I_am_Ally@comcast.com Tamara White Tamtastic@att.net Alvin Ngo...
Does any one can show me the code in C++
ll cricket LTE 80% 16:58 Back P2.B MYString v1 Detail Submission Grade For this program, your MYString variables will never need to grow beyond length 20, in program 3 you will need to be allow your string that is held in the class to be able to be larger than 20 chars. So you may want to start allowing your strings to be able to grow....if you have extra time....
C++ Lab 1. Read in the contents of a text file up to a maximum of 1024 words – you create your own input. When reading the file contents, you can discard words that are single characters to avoid symbols, special characters, etc. 2. Sort the words read in ascending order in an array (you are not allowed to use Vectors) using the Selection Sort algorithm implemented in its own function. 3. Search any item input by user in your...
10. replaceSubstring Function Write a function named replaceSubstring. The function should accept three C-string or string object arguments. Let's call them string1, string2, and string3. It should search string for all occurrences of string2. When it finds an occurrence of Programming Challenges string2, it should replace it with string. For example, suppose the three arguments have the following values: stringt: "the dog jumped over the fence" string 2 "the" string3: "that" With these three arguments, the function would return a...
Please write a java program with a input file "jabberwock.txt", and output the "output.txt" with following requirement. You and your partner will be writing a simple Java program that implements some basic file I/O operations. You can use this code as the basis for some of your next project. FIRST: Write code that prompts the user for the name of a text file, opens that file if it exists and reads the file one line at a time printing each...
FIRST: Write code that prompts the user for the name of a text file, opens that file if it exists and reads the file one line at a time printing each line to the screen. You must implement the file read in a try/catch block rather than throwing the exception on the main method. NEXT: Modify your code so that the program takes the name of two files from the command line, opens the first file if it exists for...
Need help!! Java Eclipse Please provide the screenshot of output of code as well. thank you... PROGRAM 1 –Linear Data Structure Implementation (Due date: March 5th, 2019, 5% Grade Points) Given the starting point in a maze, you are to find and mark a path out of the maze which is represented by a 30x30 array of 1s (representing hedges) and 0s (representing the foot-paths). There is only one exit from the maze (represented by E). You may move vertically...