Encerrado

small operation system

use C

Program puts prompt "How many" on the standard input. The user types an inter,NN at the [url removed, login to view] your program types a prompt "SLEEP". The user then gives the argument to be put in the sleep command (start with 0) in your program. use 0 to start with.

The program should generate two processes, PRODUCER and CONSUMER.

PRODUCER should generate expressions of the form n1+n2, where n1 and n2 are [url removed, login to view] integers should be produced by a rodom number generator and should be in the range 1-99. After it produces such an expression it should write it to file SHAREFILE. The program should produce a total of NN such expressions writing each to SHAREFILE. After the write to SHAREFILE place a "sleep(SLEEP)" command in the PRODUCER program.

COnsumer should read an expression from file SHAREFILE concatenate = n3 to it. The entire resulting expression is n1+n2 =n3, where n3 is the correct sum 0f n1 and n2. CONSUMER then puts [THE INFORMATION NECESSARY TO PRINT THAT RESULT IN THAT FORM] in its own memory, CONSOWN, location. It should process NN such expressions. CONSUMER also keeps a counter, COUNT,EACH time that CONSUMER looks for the next item in SHAREFILE and it is not there CONSUMER increments COUNTER [AND TRIES AGAIN]. When consumer has finished putting NN expressions in CONSOWN it should print them out in readable form , one expression per line. It should print out COUNT. After this printout, both processes should terminate gracefully.

In program, "12+7" -> use (fscanf and fgets) to get string

Syntax is like:

S->N+N

N->C|CD

C->1|2|3|4|5|6|7|8|9

D->0|1|2|3|4|5|6|7|8|9

example PRODUCER generated expressions

12+7

13+55

corresponding CONSUMER printout expressions

12+7=19

13+55=78

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.

3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).

4) use system call sleep(), fork(), + another if you need.

## Platform

unix sun os 5.8 , C,

gcc command to compile.

Habilidades: Programação C, PHP

Ver mais: writing prompt generator, writing standard form, writing generator, writing expressions, writing code generator, syntax programming, sun source, standard types, sleep programming, programming expression, n3, n2, integers form, work integers, fgets programming, expression programming, expression generator, programming syntax, programming fscanf, programming fgets, counter programming, argument programming, 4 tries, user inter, result system

Acerca do Empregador:
( 0 comentários ) United States

ID do Projeto: #2980260

4 freelancers estão ofertando em média $42 para este trabalho

shashikhanvw

See private message.

$56.95 USD in 4 dias
(15 Comentários)
3.8
zokker

See private message.

$25.5 USD in 4 dias
(1 Comentário)
0.0
kiwlmvw

See private message.

$42.5 USD in 4 dias
(0 Comentários)
0.0
fahadj

See private message.

$42.5 USD in 4 dias
(1 Comentário)
0.0