Шукаєте відповіді та рішення тестів для Mobile Device Programming (CS326/CSE5333/CS326n)? Перегляньте нашу велику колекцію перевірених відповідей для Mobile Device Programming (CS326/CSE5333/CS326n) в e-learning.msa.edu.eg.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
A Student Course Registration system needs to be modeled in Dart.
Develop a Dart program that represents a Student with the following information:
name (String)studentId (int)courseName (String)isRegistered (bool)Your program must include:
Student with suitable attributes and a constructor.registerCourse() that marks the student as registered only if the student is not already registered.dropCourse() that marks the student as not registered only if the student is currently registered.displayInfo() that prints all student details in a clear format.main(), create two Student objects and demonstrate course registration and course dropping for each(Code Evaluation)
Evaluate the following Flutter code. Does it correctly handle null safety, and will it display a default text if the value of message is null? If not, fix it.
String? message;
Text(message ?? 'Default Message');
(Code Evaluation)
Evaluate the correctness of the following code snippet. Does it display a CircularProgressIndicator while data is loading, and does it handle the snapshot.data null case correctly?
Future<String> fetchData() async {
await Future.delayed(Duration(seconds: 2));
return 'Data loaded';
}
FutureBuilder<String>(
future: fetchData(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator();
} else if (snapshot.hasData) {
return Text(snapshot.data!);
} else {
return Text('Error loading data');
}
},
);
(Design)
Design a Flutter app with two pages. On the first page, display a button labeled 'Go to Profile.' On the second page, display a user's profile information. Use Navigator.push and return data when navigating back.
Identify and fix the error in the following code snippet.
void main() {
int x = 5;
print("The square of x is: $x * $x");
}
(Code Examination)
Examine the following code snippet for handling Bluetooth disconnections. Identify potential issues and suggest improvements.
void disconnectBluetooth() async {
if (_connection != null && _connection!.isConnected) {
await _connection!.close();
_connection = null;
print('Disconnected from Bluetooth device');
} else {
print('No active Bluetooth connection to disconnect');
}
}
(Code Examination)
Evaluate the following Flutter code for capturing an image using the camera and displaying it in a preview. Identify issues and suggest improvements.
Future<void> captureImage() async {
final image = await _cameraController.takePicture();
setState(() {
_capturedImage = Image.file(File(image.path));
});
}
Analyze the code below. What will be printed to the console? Explain your answer.
void main() {
int sum = 0;
for (int i = 1; i <= 4; i++) {
sum += i * 2;
}
print(sum);
}
(Code Evaluation)
Examine the following code for integrating a Google Map and displaying a marker on a hardcoded location. Identify potential improvements and make the marker dynamic.
GoogleMap(
initialCameraPosition: CameraPosition(
target: LatLng(37.7749, -122.4194),
zoom: 12,
),
markers: {
Marker(
markerId: MarkerId('marker1'),
position: LatLng(37.7749, -122.4194),
),
},
);
Write a function that returns the greatest common divisor (GCD) of two numbers using a while loop.