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:





example PRODUCER generated expressions



corresponding CONSUMER printout expressions



## 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 in standard form, writing generator, writing expressions, writing a code generator, where to start programming, syntax programming, syntax in programming, sun source, standard c types, sleep programming, programming syntax, programming expression, n3, N2, integers form 1, how to work integers, how to be a producer, get a producer, fgets c programming, expression in c programming, expression generator, c programming syntax, c programming fscanf, c programming fgets

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

ID do Projeto: #2980260

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


See private message.

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

See private message.

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

See private message.

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

See private message.

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