Find Jobs
Hire Freelancers

concordance

$10-30 USD

Zaprt
Objavljeno pred več kot 10 leti

$10-30 USD

Plačilo ob dostavi
Description Using this code, without any other change, provide the missing code for function "printConcordance". It should: [login to view URL] your name followed by “CONCORDANCE” on one line [login to view URL] through keys in order [login to view URL] through words in order [login to view URL] you find the key, print the following on one line: 1.<= 3 preceding words (with spaces between) [login to view URL] “ >> “, key, “ << ” 3.<=3 following words (with spaces between) Code /* implement KWIC w/o data structures other than string & array - accept restrictions */ #include <iostream> #include <fstream> #include <stdlib.h> using namespace std; #define MAXWORDS 100 string myFile = "[login to view URL]"; string words [MAXWORDS]; // severe limitation!! int nWords=0; int readWords(const char* fileName, int maxWords, string words[]) { int nWords=0; ifstream inpt; [login to view URL] (fileName, std::ifstream::in); if (!inpt.is_open()) { cout << " ! failed to open " << myFile << endl; exit(1); } string word; while ( inpt>> word && nWords<maxWords) { words[nWords++] = word; cout << "input: " << word << endl; } [login to view URL](); return nWords; } bool findKey(const string target, const int nWrds, const string wrds[]) { //cout << "search for " << target << endl; for (int i=0; i<nWrds; i++) { //cout << " compare " << target << "to " << wrds[i] << endl; if ([login to view URL](wrds[i])==0) return true; } return false; } // inserts word in lexicographic order into wrds and returns number of words int insertSortedKey(string newWrd, const int nWrds, string wrds []) { //cout << "inserting: " << newWrd ; int insertionPoint =0; while (insertionPoint<nWrds ) { if ([login to view URL](wrds[insertionPoint])<0) break; insertionPoint++; } int j = nWrds; while (j>insertionPoint) { wrds[j]=wrds[j-1]; j--; } //cout << " at " << insertionPoint << endl; wrds[insertionPoint]= newWrd; return nWrds+1; } int getSortedKeys(const int nWrds, string wrds[], string keys[]) { int nKeys=0; for (int i = 0; i<nWords; i++) { if (!findKey(wrds[i],nKeys,keys)) { nKeys = insertSortedKey(wrds[i], nKeys, keys); } } return nKeys; } void printConcordance(const int nKeys, const string keys[], const int nWords, const string words[]) { / / deleted } int main () { // read words nWords = readWords(&myFile[0], MAXWORDS, words); // for (int i =0; i<nWords; i++) // cout << words[i] << endl; string keys[MAXWORDS]; int nKeys = getSortedKeys(nWords, words, keys); // for (int i =0; i<nKeys; i++) // cout << "key: " << keys[i] << endl; printConcordance(nKeys, keys, nWords, words); return 0; }
ID projekta: 5345557

Več o projektu

11 ponudb
Projekt na daljavo
Aktivno pred 10 leti

Želite zaslužiti?

Prednosti oddajanja ponudb na Freelancerju

Nastavite svoj proračun in časovni okvir
Prejmite plačilo za svoje delo
Povzetek predloga
Registracija in oddajanje ponudb sta brezplačna
11 freelancerjev je oddalo ponudbo s povprečno vrednostjo $23 USD za to delo
Avatar uporabnika
Hi, I am C++ expert and can surely help you here with this project, Please let me know if you are interested. Thank You
$30 USD v 1 dnevu
4,7 (196 ocen)
6,6
6,6
Avatar uporabnika
hi this is Asad, i have a lot of experience in c++ programming, this is very simple task for me,hire me wont disappoint you cheers :) p.s price in negotiable
$20 USD v 1 dnevu
5,0 (38 ocen)
6,1
6,1
Avatar uporabnika
Hello Hiring Manager! i have done graduation in computer science. i have an experience of 4+ years in web designing and web development and have been doing job in software house since last 4 years. i am an expert in php, c++,jquer, ajax, htm, css and psd to html conversion. i am also master template designer and had recently designed 5 master templates each having 30 themes kindly visit my profile and see i have done 3 jobs in c++ and send them on time so that students dont get late. i will complete your job in few hours .so send me message and award me.i am ready to start it now. thanks
$30 USD v 0 dnevu
4,8 (12 ocen)
3,9
3,9
Avatar uporabnika
Done a lot of works in C / C++ and optimizations, also working on mobile platforms which are critical to speed and resources
$25 USD v 3 dneh
5,0 (3 ocen)
3,7
3,7
Avatar uporabnika
hello , all i need is 24 hours as i am a bit bsy right now ............. thanx ... waiting for your reply .... regards.....................
$20 USD v 1 dnevu
4,9 (8 ocen)
3,3
3,3
Avatar uporabnika
A proposal has not yet been provided
$24 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
i have worked on various langaues like c, c++ with windows api and opengl, java, xhtml/html, sql, php 4/5, java script, objective c, css/css3, action script etc............…
$17 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
A proposal has not yet been provided
$25 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
I have been programming in C++ for many years and have a BS degree in computer science. Also I am available to start on this project immediately.
$10 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
Hello, cdixon222. I think, I can do your task in one day. Best regards, Vladimir Khadorik. my skype - khadorik.
$20 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
void printConcordance(const int nKeys, const string keys[], const int nWords, const string words[]) { printf("enter your name:"); char name[10]; scanf("%s",name); printf("%s CONCORDANCE",name); int no_keys; int no_words; int firstword; int secondword; int thirdword; int fourthword; int fifthword; int sixthword; for(no_keys=0;no_keys<nKeys; no_keys++) for(no_words=0;no_words<nWords;no_words++) { if(words[no_words]==keys[no_keys] && no_words>2) {firstword=no_words-3; secondword=no_words-2; thirdword=no_words-1; printf("%s %s %s",words[firstword],words[secondword],words[thirdword]);} printf(">> %s <<",keys[no_keys]); if(words[no_words]==keys[no_keys] && (no_words+3)<nWords) { fourthword=no_words+1; fifthword=no_words+2; sixthword=no_words+3; printf("%s %s %s\n",words[fourthword],words[fifthword],words[sixthword]); } } }
$37 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0

O stranki

Zastava UNITED STATES
Hallandale Beach, United States
5,0
16
Član(ica) od jan. 21, 2014

Verifikacija stranke

Hvala! Po e-pošti smo vam poslali povezavo za prevzem brezplačnega dobropisa.
Pri pošiljanju vašega e-sporočila je šlo nekaj narobe. Poskusite znova.
Registrirani uporabniki Skupaj objavljenih del
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Nalaganje predogleda
Geolociranje je bilo dovoljeno.
Vaša prijavna seja je potekla, zato ste bili odjavljeni. Prosimo, da se znova prijavite.