This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
Future<void> main() async { | |
keyboardInput(); | |
///ex.1.2 | |
keyboardInput().then((stroke_name) => print('Введена строка $stroke_name')); | |
///ex.1.3 | |
await keyboardInput().then((value) => print('Введенное значение: $value')); | |
///ex.2.2 | |
keyboardInput().then((value) => readString(value).listen((event)=>print('Введена строка $event'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main(){ | |
Student student = Student(yearOfAdmission: DateTime.now(), surname: 'Movchan', name: "Maksim"); | |
print( student.toString()); | |
final Truck truck = Truck(weight: 2.0); | |
truck.runEngine(weight: truck.weight); | |
Sportcar(weight: 1.5).runEngine(weight: 1.5); | |
Bike(color: Colors.green); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
const String a = 'hello world'; | |
void main() { | |
replaceHelloWorld(value: a); | |
///ex.2 | |
List<int> array = [1, 3, 2, 5, 2, 3, 3, 3]; | |
print(average(array: array)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///2.5 Управляющие конструкции | |
import 'dart:io'; | |
void main() { | |
///ex.1 | |
///Используя switch, напишите программу в методе main(), которая выводит название месяца по номеру от 1 до 12. | |
print('Ex.1: Введите номер от 1 до 12'); | |
int monthNum=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///ex. 1 | |
int a = 1; | |
void main() { | |
///ex 2 | |
double b=0.0; | |
var text='s'; | |
///ex. 3 Значение типа 'Строка' невозможно присвоить значению типа int |