-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment_4.dart
40 lines (36 loc) · 961 Bytes
/
Assignment_4.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import 'dart:io';
void main() {
//Assignment 4 In Dart
print("Enter Car Model To Get Its Current Price:");
String car = stdin.readLineSync()!;
if (car != "") {
cars(car);
} else {
print("Please Enter Car Model To Get Its Current Price:");
}
}
cars(String car) {
Map<String, String> Cars_Price = {
"Toyota Corolla": "3,800,000",
"Toyota Yaris": "2,749,000",
"Toyota Fortuner": "8,149,000",
"Honda City": "2,599,000",
"Honda Civic": "3,979,000",
"Honda Accord": "11,999,000",
"Kia Stonic": "3,660,000",
"Kia Sportage": "5,000,000",
"Kia Picanto": "1,781,000",
"Hyundai Tucson": "5,469,000",
"Hyundai Sonata": "6,499,999",
"Hyundai Elantra": "39,99,000"
};
if (Cars_Price.containsKey(car)) {
Cars_Price.forEach((key, value) {
if (car == key) {
print("Price of $key is PKR:$value");
}
});
} else {
print("We Dont Have Record Of This $car Car !!!");
}
}