Object A
- value (float)
- color (str)
Object B
- function (str)
- value (float)
Object C
- value (list of float)
- Create a database
DB
to store objectsA
,B
andC
each in a separate table - Implement a function that takes
A
andB
and returnC
, whereB.function
applies toA.value
andB.value
and the result is stored inC.value
with an index that depends onA.color
according to the map:
COLOR 2 INDEX MAP
- red -> 0
- green -> 1
- blue -> 2
Example 1
INPUT 1
A.value
= 3A.color
= greenB.function
= sumB.value
= 3
OUTPUT 1
C.value
= [ 0, 6, 0 ]
Example 2
INPUT 2
A.value
= 2A.color
= redB.function
= powB.value
= 2
OUTPUT 2
C.value
= [ 4, 0, 0 ]
- Implement a function similar to function-2 but with
INPUT
fromDB
andOUTPUT
toDB
- Add REST endpoints to function-2 and function-3
- Wrap it all up in a Docker container (i.e. write
Dockerfile
anddocker-compose.yaml
)