Basic C Program

Cancelado Publicado Apr 8, 2007 Pagado a la entrega
Cancelado Pagado a la entrega

Write a program to input and process a text string. The program should print out each word and its length contained in the input text string. The program should handle obvious cases such as punctuation, multiple white spaces between words and line feeds, and also allow any non-punctuation within a word (such as first-hand, EE2372, IBM-370).

## Deliverables

The output is as follows:

WORD SIZE

name 4

non-punctuation 15

.......

First run your program as usual by using the keyboard to input a few words. Then, use text editor to create a data file containing the third sentence of this assignment as input to test your program. Use the following unix commands to tun the program and print the results.

cat filename.c > results (copy source to file results)

cat filename.d >> results (append data file to results)

[login to view URL] < filename.d >>results (execute the program with input from data file and output to results)

This is what i've done for the first part as far as typing the input text string. It works but not if you have spaces between words or anything. Don't know how to include the data file to work with this.

#include <stdio.h>

#include <string.h>

main()

{

int c;

char string[81];

scanf("%s", string);

printf("WORD\t\tSIZE\n");

printf("%-15s %d\n", string, strlen(string));

}

## Platform

needs to run on UNIX and/or LINUX.

Programación en C Ingeniería MySQL PHP Gestión de proyectos Arquitectura de software Verificación de software

Nº del proyecto: #2915423

Sobre el proyecto

5 propuestas Proyecto remoto Activo Apr 9, 2007

5 freelancers están ofertando un promedio de $23 por este trabajo

philippvw

See private message.

$55.25 USD en 14 días
(42 comentarios)
5.7
macspainvw

See private message.

$25.5 USD en 14 días
(2 comentarios)
1.4
jbastow

See private message.

$12.75 USD en 14 días
(2 comentarios)
1.1
egatesvw

See private message.

$8.5 USD en 14 días
(0 comentarios)
0.0
sean0101a

See private message.

$15.3 USD en 14 días
(0 comentarios)
0.0