Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
need to make a string matching program that takes input from a text file and outputs that match (if there is one) asked from the user. i have done this part , the only problem is that , with the output match , i also need to print some words before and after the actual match , like you would search in google and it gives you the results , with extra details .... how could i do that sort of searching?
here is my program ..
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
ifstream myfile ("text.txt");
string line;
int offset;
string tosearch;
cout<< "Enter the word to be searched from the text file" << endl;
cin>> tosearch;
while (!myfile.eof())
getline(myfile,line);
if (offset = line.find(tosearch, 0) != string::npos)
cout << "The word has been found"<< endl;
}
cin.get();
return 0;
Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display:the total rainfall for the year,the average monthly rainfall,and the months w..
This program will simulate the game of Hearts, which is a four-player trick-taking game using any ordinary deck of playing cards. Each player is dealt thirteen cards. Whoever is dealt the Two of Clubs must lead it to the first trick. Each person p..
Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..
Create an application that has two heaps. Place a linked list into each heap. Select one hundred random numbers. Place each of the random numbers into each heap - CSI 345 - Spring 2014 S2
Keep track of the size of the array so that you cannot exceed the array boundaries. The implementation details (i.e. the private members)of your class are up to you, but the class should have the following public interface
write a program that reads an array with wind-tunnel test data then allowss the user to enter a flight-path angle. If the angle is within the bounds of the data set, the program should then use linear inteerpolation to compute the corresponding coeff..
8-bit or 16-bit mode, and the prescaling ratio. You can assume XTAL = 10M Hz or at the frequency you specify.
We have to deal with student pilots and airplanes. Students have a unique student id, a name, and a year that students are in. Airplanes have a unique airplane id, model, a cruising range
Write the entire definition for the main function that prints out all of the command-line arguments on its own line.
A constructor and a destructor, Insert a new element chosen by the user at the correct place in the list
Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to variable y and allots 40 to variable z if variable x is greater that 100.
Prepare a C/C++ program that uses the PTHREAD library to create threads and mutexes to synchronize them.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd