Consider the following part of a class. socket is a class variable of type Qudp Socket* and ctr a class variable of type

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Consider the following part of a class. socket is a class variable of type Qudp Socket* and ctr a class variable of type

Post by answerhappygod »

Consider The Following Part Of A Class Socket Is A Class Variable Of Type Qudp Socket And Ctr A Class Variable Of Type 1
Consider The Following Part Of A Class Socket Is A Class Variable Of Type Qudp Socket And Ctr A Class Variable Of Type 1 (179.34 KiB) Viewed 19 times
Consider the following part of a class. socket is a class variable of type Qudp Socket* and ctr a class variable of type int. 1 #include "udpserver.h" 2 #include <QDebug> 3 4 UdpServer :: UdpServer (Q0bject *parent): QObject (parent) 5 { 6 ctr = 0; 7 socket new QUdpSocket (this); 8 socket->bind (QHostAddress:: Any, 7000); 9 connect (socket, SIGNAL (readyRead ()), this, SLOT (read())); 10 } 11 void UdpServer::read() 12 { 13 while (socket->has PendingDatagrams ()) 14 { 15 QNetworkDatagram datagram = socket->receive Datagram (); qDebug() << datagram.data(); 16 17 QByteArray reply socket->writeDatagram "We spoke "+ QByteArray:: number (++ctr) + " times"; (datagram.makeReply(reply)); 18 19 } 20 } (b) Teken 'n klasdiagram wat die oorerwings- en bevattingseienskappe wat uit die kode blyk, toon. Draw a class diagram that displays the inheritance- and containment relationships evi- dent from the code. (8)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply