فهرس الكتباللغة البرمجية دارت

حل السؤال

حل السؤال 33

import 'dart:io';
void main() {
  stdout.write('Enter the midterm score (0 - 100): ');
  int midterm = int.parse(stdin.readLineSync()!);
  stdout.write('Enter the final score (0 - 100): ');
  int finalScore = int.parse(stdin.readLineSync()!);
  stdout.write('Enter the attendance score (0 - 100):');
  int attendance = int.parse(stdin.readLineSync()!);
  double average = (midterm * 0.4 + finalScore * 0.5 +
                                      attendance * 0.1);
  print('---------------------------');
  print('Your average score: ${average.toStringAsFixed(2)}');
  if (average >= 60.0) {
    print('Congratulations, you passed');
  } else {
    print('Sorry, you failed');
  }
}
العودة إلى السؤال نفسه