Professional Documents
Culture Documents
SHT
SHT
Лабораторна робота №1
Виконала:
студентка V курсу каф.
ПЗКС ФПМ
групи КП-31мп
Музичук Марина
Анатоліївна
Перевірила:
Боярінова Ю.Є.
Київ 2023
Індивідуальне завдання
function App() {
return (
<SafeAreaView style={styles.wrapper}>
<Barcode numberValue={string + lastNumber} />
<View style={styles.inputWrapper}>
<Text>
Input numbers
</Text>
<TextInput
style={styles.input}
onChangeText={handleInputChange}
value={inputString}
placeholder="input here"
keyboardType="numeric"
maxLength={7}
/>
</View>
</SafeAreaView>
);
}
return (
<View style={styles.wrapper}>
<BarItemList splitedCharsLeft={splitedCharsLeft}
splitedCharsRight={splitedCharsRight}/>
</View>
)
}
return (
<View style={styles.wrapper}>
{
splitedCharsLeft.map(char => {
return (
<BarItem char={char} isLeft={true}/>
)
})
}
{
splitedCharsRight.map(char => {
return (
<BarItem char={char} isLeft={false}/>
)
})
}
</View>
)
}
return (
<View style={[styles.wrapper, ['start', 'end'].includes(char) ?
{width: 12} : char === 'devider' ? {width: 20} : {width: 28}]}>
<View style={[styles.strokeListWrapper, ['start', 'end',
'devider'].includes(char) ? { height: '100%' } : { height: '76%' }]}>
{
barcode.map((barcodeItem, index) => {
return (
<Stroke value={barcodeItem}
color={barcodeItem ? '#000' : '#fff'}/>
)
})
}
</View>
<Text style={styles.charWrapper}>
{['start', 'end', 'devider'].includes(char) ? '' : char}
</Text>
</View>
)
}
function findNextMultipleOfTen(n) {
return Math.ceil(n / 10) * 10;
}
export const getLastNumberOfGoodsId = (parsedArrOfNumbers) => {
let r1 =0, r2 = 0
parsedArrOfNumbers.forEach((number, index) => {
if((index + 2) % 2 === 0){
r1 += number
}
else{
r2 += number
}
});
r1 = r1 * 3
const r = r1 + r2
const c = findNextMultipleOfTen(r) - r
return c
}
Приклади результатів
Висновки