Find Jobs
Hire Freelancers

concordance

$10-30 USD

Cerrado
Publicado hace más de 10 años

$10-30 USD

Pagado a la entrega
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 del proyecto: 5345557

Información sobre el proyecto

11 propuestas
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
11 freelancers están ofertando un promedio de $23 USD por este trabajo
Avatar del usuario
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 en 1 día
4,7 (196 comentarios)
6,6
6,6
Avatar del usuario
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 en 1 día
5,0 (38 comentarios)
6,1
6,1
Avatar del usuario
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 en 0 día
4,8 (12 comentarios)
3,9
3,9
Avatar del usuario
Done a lot of works in C / C++ and optimizations, also working on mobile platforms which are critical to speed and resources
$25 USD en 3 días
5,0 (3 comentarios)
3,7
3,7
Avatar del usuario
hello , all i need is 24 hours as i am a bit bsy right now ............. thanx ... waiting for your reply .... regards.....................
$20 USD en 1 día
4,9 (8 comentarios)
3,3
3,3
Avatar del usuario
A proposal has not yet been provided
$24 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
A proposal has not yet been provided
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hello, cdixon222. I think, I can do your task in one day. Best regards, Vladimir Khadorik. my skype - khadorik.
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Hallandale Beach, United States
5,0
16
Miembro desde ene 21, 2014

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.