logo

Crowdly

Browser

Add to Chrome

Mobile Device Programming (CS326/CSE5333/CS326n)

Looking for Mobile Device Programming (CS326/CSE5333/CS326n) test answers and solutions? Browse our comprehensive collection of verified answers for Mobile Device Programming (CS326/CSE5333/CS326n) at e-learning.msa.edu.eg.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

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:

  1. A class named Student with suitable attributes and a constructor.
  2. A method registerCourse() that marks the student as registered only if the student is not already registered.
  3. A method dropCourse() that marks the student as not registered only if the student is currently registered.
  4. A method displayInfo() that prints all student details in a clear format.
  5. In main(), create two Student objects and demonstrate course registration and course dropping for each
View this question

(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');

View this question

(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');

    }

  },

);

View this question

(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.

View this question

Identify and fix the error in the following code snippet.

 

 

void main() {

  int x = 5;

  print("The square of x is: $x * $x");

}

View this question

 (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');

  }

}

View this question

(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));

  });

}

View this question

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);

}

View this question

(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),

    ),

  },

);

View this question

Write a  function that returns the greatest common divisor (GCD) of two numbers using a while loop.

 

 

View this question

Want instant access to all verified answers on e-learning.msa.edu.eg?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome