If you have any doubts, please give me comment...
#include<iostream>
#include<fstream>
#include<sstream>
#include<cctype>
#include<string>
using namespace std;
string toLower(const string &str);
int main(){
ifstream in;
in.open("email_template.txt");
if(in.fail()){
cout<<"Unable to open email_template.txt"<<endl;
return -1;
}
string line, fname, uname, email;
string temp_copy, temp="";
int pos;
while(!in.eof()){
getline(in, line);
temp += line+"\n";
}
in.close();
in.open("email_list.txt");
if(in.fail()){
cout<<"Unable to open email_list.txt"<<endl;
return -1;
}
cout<<"Email Creator"<<endl<<endl;
while(!in.eof()){
getline(in, line);
istringstream ss(line);
getline(ss, fname, '\\');
getline(ss, uname, '\\');
getline(ss, email, '\\');
fname = toLower(fname);
fname[0] = toupper(fname[0]);
email = toLower(email);
temp_copy = temp;
while((pos=temp_copy.find("{email}"))!=string::npos){
temp_copy.replace(pos, 7, email);
}
while((pos=temp_copy.find("{first_name}"))!=string::npos){
temp_copy.replace(pos, 12, fname);
}
cout<<"========================================================"<<endl;
cout<<temp_copy;
}
in.close();
return 0;
}
string toLower(const string &str){
string result = "";
for(int i=0; i<str.size(); i++){
result += tolower(str[i]);
}
return result;
}
In C++ please! Project 6-1: Email Creator Create a program that reads a file and creates...
Java Email Template Application: Create an application that creates a series of emails as outlined below. Create an array of email addresses that include the following data: " james ,butler,[email protected]" "Josephine,Darakjy,[email protected]" "ART,VENERE,[email protected]" Store a template for a mass email like this: String template = "To: {email}\n" + "From: [email protected]\n" + "Subject: Deals!\n\n" + "Hi {first_name},\n\n" + "We've got some great deals for you. Check our website!"; When the application starts, it should read the email...
I can't get the program to read from prospect.csv file and produce the correct prospect_clean.csv file. Can you help with explanation to the answer? Project 15-3: File Cleaner Create an application that reads a file that contains an email list, reformats the data, and writes the cleaned list to another file. Console File Cleaner Source file: prospects.csv Cleaned file: prospects_clean.csv Congratulations! Your file has been cleaned! The prospect.csv file FIRST,LAST,EMAIL james,butler,[email protected] Josephine,Darakjy,[email protected] ART,VENERE,[email protected] ... The prospect_clean.csv file First,Last,email James,Butler,[email protected] Josephine,Darakjy,[email protected] Art,Venere,[email protected]...
Hello can somebody please help me with Project 15-3 File Cleaner assignment? This project is to be done while using Java programming. Here are what the assignment says… Create an application that reads a file that contains an email list, reformats the data, and writes the cleaned list to another file. Below are the grading criteria… Fix formatting. The application should fix the formatting problems. Write the File. Your application should write a file named prospects_clean.csv. Use title case. All...
C++ There are to be two console inputs to the program, as explained below. For each input, there is to be a default value, so that the user can simply press ENTER to accept any default. (That means that string will be the best choice of data type for the console input for each option.) The two console inputs are the names of the input and output files. The default filenames are to be fileContainingEmails.txt for the input file, and...
User Profiles Write a program that reads in a series of customer information -- including name, gender, phone, email and password -- from a file and stores the information in an ArrayList of User objects. Once the information has been stored, the program should welcome a user and prompt him or her for an email and password The program should then use a linearSearch method to determine whether the user whose name and password entered match those of any of...
Please write this in C. Write this code in Visual Studio and upload your Source.cpp file for checking (1) Write a program to prompt the user for an output file name and 2 input file names. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs opening any of the 3 For example, (user input shown in caps in first line) Enter first...
C++ Guessing game. Create a project titled Lab4_Guess with a single file titled guess.cpp Program the following game. The computer selects a random number between 1 and 100 and asks the user to guess the number. If the user guesses incorrectly, the computer advises to try larger or smaller number. The guessing repeats until the user guesses the number. The dialog should look as follows (user input is shown in bold): Guess a number between 1 and 100: 50 try...
CREATE TWO C++ PROGRAMS : Program 1 Write a program that reads in babynames.txt (provided) and outputs the top 20 names, regardless of gender. The file has the following syntax: RANK# BoyName Boy#OfBirths Boy% GirlName Girl#OfBirths Girl% You should ignore the rank and percentages. Compare the number of births to rerank. Output should go to standard out. Program 2 Write a program that reads a text file containing floating-point numbers. Allow the user to specify the source file name on...
in c++ please Page 1 of 3 (PRO) Project Assignment Instructions Last Charged: 6/1/2020 Read and follow the directions below carefully and perform the steps in the order listed. You will be solving one program as instructed and turning in your work electronically via an uploaded file within Eagle Online/Canvas and copy & paste the program to the Text Entry box as well. Make sure and check your work prior to uploading the assignment (NOTE: For Steps 1 & 2...
C++ Purpose: To practice arrays of records, and stepwise program development. 1. Define a record data type for a single playing card. A playing card has a suit ('H','D','S',or 'C'), and a value (1 through 13). Your record data type should have two fields: a suit field of type char, and a value field of type int. 2. In main(), declare an array with space for 52 records, representing a deck of playing cards. 3. Define a function called initialize()...