CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 14:13:59 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=00cda1c782caf5ada2c36f2162325253942164e4e3cd5d0d0d28e6feb41a7998a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22BWwvAiI7wCeKwfZ7zZIU2iCBo8okQsTj%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cef6155f2bccbb-BLR
госы_люди_dart - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- // Create a list containing three objects of each class.
- List<People> peopleList = [
- People(name: 'Alice', age: 25),
- People(name: 'Bob', age: 32),
- People(name: 'Charlie', age: 28),
- Worker(name: 'David', age: 40, post: 'Engineer', salary: 60000),
- Worker(name: 'Eve', age: 35, post: 'Manager', salary: 75000),
- Worker(name: 'Fred', age: 29, post: 'Analyst', salary: 55000),
- Student(name: 'Grace', age: 20, marks: [85, 90, 92], subjects: ['Math', 'Science', 'History']),
- Student(name: 'Henry', age: 22, marks: [78, 82, 88], subjects: ['English', 'Art', 'Music']),
- Student(name: 'Ivy', age: 21, marks: [92, 95, 98], subjects: ['Physics', 'Chemistry', 'Biology']),
- ];
- // Print information about each person using the toString method.
- print('Information about each person:');
- for (var person in peopleList) {
- print(person);
- }
- // Print the names of those who are younger than 30 years old.
- print('\nNames of people younger than 30:');
- for (var person in peopleList) {
- if (person.age < 30) {
- print(person.name);
- }
- }
- // Calculate the average salary of all workers.
- double averageSalary = 0;
- int workerCount = 0;
- for (var person in peopleList) {
- if (person is Worker) {
- averageSalary += person.salary;
- workerCount++;
- }
- }
- averageSalary = workerCount > 0 ? averageSalary / workerCount : 0;
- // Count the number of Worker objects with a salary below the average.
- int workersBelowAverage = 0;
- for (var person in peopleList) {
- if (person is Worker && person.salary < averageSalary) {
- workersBelowAverage++;
- }
- }
- print('\nNumber of workers with salary below average: $workersBelowAverage');
- // Print information about the subjects of each Student.
- print('\nSubjects of each student:');
- for (var person in peopleList) {
- if (person is Student) {
- print('${person.name}: ${person.subjects}');
- }
- }
- }
- class People {
- final String name;
- final int age;
- People({required this.name, required this.age});
- @override
- String toString() => 'Name: $name, Age: $age';
- }
- final class Worker extends People {
- final String post;
- final int salary;
- Worker({
- required super.name,
- required super.age,
- required this.post,
- required this.salary,
- });
- @override
- String toString() => 'Name: $name, Age: $age, Post: $post, Salary: $salary';
- }
- final class Student extends People {
- final List<int> marks;
- final List<String> subjects;
- Student({
- required super.name,
- required super.age,
- required this.marks,
- required this.subjects,
- });
- @override
- String toString() => 'Name: $name, Age: $age, Marks: $marks, Subjects: $subjects';
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 8 sec ago | 0.24 KB
-
⭐⭐⭐ChangeNOW Exploit⭐⭐
Java | 11 sec ago | 0.10 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 17 sec ago | 0.24 KB
-
⭐⭐⭐MAKE $9OO INSTANTLY D M⭐⭐
Java | 22 sec ago | 0.10 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 26 sec ago | 0.24 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 35 sec ago | 0.10 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 35 sec ago | 0.24 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 44 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand