logo

Crowdly

Browser

Add to Chrome

Questions Bank (1387191 total)

El sistema dado por

View this question

Un sistema eléctrico con dos condensadores en paralelo y una resistencia en serie con ambos se modelaría como un sistema de segundo orden

0%
0%
View this question

TASK 1. Match sleep problems with their definitions.

View this question
Where should you go immediately if you get chemicals in your eyes in a laboratory?
0%
0%
100%
0%
0%
View this question

TASK 5. Answer the questions. 

  1. Have you ever heard of any of the sleeping disorders mentioned in the video? If so, which one(s) and what do you know about them?

  2. Can you think of any potential reasons for developing insomnia, restless leg syndrome, or other sleep disorders mentioned in the video?

  3. What are some common symptoms that someone may experience a sleep disorder? Have you ever experienced any of these symptoms yourself or known someone who has?

  4. In the video, they mentioned shiftwork disorder. Do you think working irregular shifts or night shifts can affect a person's sleep quality? How might this impact their overall well-being?

  5. If you had a friend or family member who was experiencing symptoms of a sleep disorder, what advice would you offer to them?

View this question

Votre réponse à la question 4.3 :Compléter la définition de la classe abstraite Question qui dérive (hérite) de Activite et implémente l’interface Evaluable. La classe Question comporte 3 nouveaux attributs dont 2 sont privés et 1 est protégé. Vous devez définir le constructeur qui reçoit les valeurs initiales de tous les attributs et les accesseurs aux attributs privés (pas protégé)  :

public abstract class Question {

    private String questionPosee;

    private double ponderation;

    protected Reponse reponseCorrecte;

    public

    public Question(String titre, String description, String questionPosee, double ponderation, Reponse reponseCorrecte) {

        //...

    }

    //...
}

View this question

Votre réponse à la question 4.2 :Compléter la définition de la méthode estMalFormee() de la classe Reponse. Une réponse est mal formée lorsqu’elle contient 2 éléments identiques ::

public boolean estMalFormee() {

   //Indique s'il y a 2 éléments de réponse identiques:

}

View this question

Votre réponse à la question 3 : Swing et Observer

Voici une application qui gère la liste de contacts des étudiants du cours INF111.  L'application est programmée en Java-Swing, implémente le patron de conception Observer et respecte l'architecture MVC (Model-View-Controller). Cette application possède deux fonctionnalités: Ajouter et supprimer le contact d'un étudiant (nom et téléphone). Compléter le code afin que l'application fonctionne correctement.

Image failed to load

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.util.ArrayList;

import java.util.List;

// Interface de l'observateur :

interface

Observateur

{

void seMettreAJour();

}

// La classe Observable :

public class

Observable

{

private List<Observateur> observateurs = new ArrayList<>();

public void ajouterObservateur(Observateur observateur) {

observateurs.add(observateur);

}

private void notifierObservateurs() {

for (Observateur observateur : observateurs) {

observateur.{1:MCS:=seMettreAJour()~update()~updateObserver()};

}

}

}

// La classe Model pour les étudiants joue le rôle de l'Observable

public class

EtudiantModel

{1:MCS:=extends~implements~inherits} {1:MCS:=Observable~Observer~Model} {

private List<String> etudiants = new ArrayList<>();

public void ajouterEtudiant(String etudiant) {

etudiants.add(etudiant);

notifierObservateurs();

}

public void supprimerEtudiant(int selectedIndex) {

etudiants.remove(selectedIndex);

notifierObservateurs();

}

public List<String> getEtudiants() {

return {1:MCS:=etudiants~observateurs};

}

}

// La classe View pour afficher la liste des étudiants

public class

EtudiantView

extends JFrame {1:MCS:=implements~extends~inherits} {1:MCS:=Observateur~Observer~Observable}{

private EtudiantModel model;

private DefaultListModel<String> etudiantListModel;

private JList<String> etudiantList;

public EtudiantView(EtudiantModel model) {

this.model = model;

model.ajouterObservateur(this);

this.{1:MCS:=setTitle~setText~putTitle}("Gestion des Étudiants");

this.setDefaultCloseOperation(JFrame.{1:MCS:=EXIT_ON_CLOSE~HIDE_ON_CLOSE~QUIT_ON_CLOSE});

this.setSize(600, 300);

this.setLocation(500,500);

this.setLayout(new BorderLayout());

etudiantListModel = new DefaultListModel<>();

etudiantList = new JList<>({1:MCS:=etudiantListModel~Etudiants~model.getEtudiants()});

etudiantList.setBorder(BorderFactory.createTitledBorder("Liste des Étudiants"));

etudiantList.{1:MCS:=setBackground~setColor~backgroundColor}(Color.LIGHT_GRAY);

this.add(etudiantList, BorderLayout.CENTER);

this.{1:MCS:=setVisible(true)~displayWindow(true)~makeVisible(true)};

}

@Override

public void {1:MCS:=seMettreAJour()~notifierObservateurs()~notifyObserver()} {

etudiantListModel.clear();

for (String etudiant : model.getEtudiants()) {

etudiantListModel.addElement(etudiant);

}

}

public JList<String> getEtudiantList() {

return {1:MCS:=etudiantList~etudiantListModel~etudiants};}

}

// La classe Controleur pour gérer les interactions :

public class

EtudiantController

implements ActionListener {

private EtudiantModel model;

private JTextField nomEtudiantField;

private JTextField phoneEtudiantField;

private JButton ajouterButton, supprimerButton;

public EtudiantController(EtudiantModel model, EtudiantView view) {

this.model = model;

JPanel controlPanel = new JPanel(new {1:MCS:=GridLayout~FlowLayout~BorderLayout}(4, 2));

// Champ de saisie pour le nom

nomEtudiantField = new JTextField();

controlPanel.add(new {1:MCS:=JLabel~JText~JTitle}("Nom de l'Étudiant:"));

controlPanel.add(nomEtudiantField);

// Champ de saisie pour le numéro de téléphone

phoneEtudiantField = new JTextField();

controlPanel.add(new {1:MCS:=JLabel~JText~JTitle}("Numéro de Téléphone:"));

controlPanel.add(phoneEtudiantField);

ajouterButton = new JButton("Ajouter un étudiant");

controlPanel.add(ajouterButton);

ajouterButton.{1:MCS:=addActionListener~addActionPerformed~actionPerformed}(this);

// Bouton pour supprimer un contact

supprimerButton = new JButton("Supprimer un étudiant");

controlPanel.add(supprimerButton);

supprimerButton.{1:MCS:=addActionListener~addActionPerformed~actionPerformed}(this);

view.add({1:MCS:=controlPanel~ajouterButton~supprimerButton}, BorderLayout.NORTH);

}

@Override

public void {1:MCS:=actionPerformed~addActionListener~addActionPerformed}(ActionEvent evt) {

Object source = evt.getSource();

if (source==ajouterButton) {

String nomEtudiant = nomEtudiantField.getText();

String phoneEtudiant = phoneEtudiantField.getText();

if (!nomEtudiant.isEmpty() && !phoneEtudiant.isEmpty()) {

model.ajouterEtudiant(nomEtudiant + " - " + phoneEtudiant);

nomEtudiantField.setText("");

phoneEtudiantField.setText("");

}

}

else if (source==supprimerButton) {

int selectedIndex = view.getEtudiantList().getSelectedIndex();

if (selectedIndex != -1) {

model.supprimerEtudiant(selectedIndex);

}

}

}

}

// Classe principale pour démarrer l'application

public class

GestionEtudiantstApp

{

public static void main(String[] args) {

SwingUtilities.invokeLater(() -> {

EtudiantModel model = new EtudiantModel();

EtudiantView view = new EtudiantView(model);

new EtudiantController(model, view);

});

}

}

View this question

1) Побудувати матриці суміжності та інцидентності.

2) Визначити півстепені виходу та входу для кожної вершини.

3) Побудувати покроково матрицю відстаней методом піднесення в степінь матриці суміжності.

4) Побудувати матрицю досяжності.

5) Визначити тип зв'язності графу за допомогою побудованих матриць досяжності та суміжності.

View this question

Задана булева функція  f (x, y, z): 

1. Побудувати таблицю істинності даної булевої функції та за таблицею істинності дослідити, які змінні є фіктивними, а які — істотними.

2. За допомогою еквівалентних перетворень визначити фіктивні змінні даної булевої функції.

3. Записати кон’юнктивне розкладання функції f (xyz) за змінними xz.

View this question