Get premium membership and access questions with answers, video lessons as well as revision papers.
A code is simply a piece of instruction to a computer which is written by a computer programmer,e.g printf("Hello world!");A program on the other hand is a set of instructions written by a computer programmer to perform a given task in a computer.It is a collection of codes, e.g
#include (stdio.h)
int main( )
{ printf("Hello world!");
return 0;
STEPHKIMOTHO answered the question on May 26, 2018 at 07:28
- Explain three techniques of detecting deadlocks in a computer system(Solved)
Explain three techniques of detecting deadlocks in a computer system.
Date posted: May 16, 2018. Answers (1)
- Explain common types of computer networks(Solved)
Explain common types of computer networks.
Date posted: May 16, 2018. Answers (1)
- What is social Engineering?(Solved)
What is social Engineering?
Date posted: May 16, 2018. Answers (1)
- Explain characteristics of information security within an organization? (Solved)
Explain characteristics of information security within an organization?
Date posted: May 16, 2018. Answers (1)
- Giving examples explain threats to data security(Solved)
Giving examples explain threats to data security.
Date posted: May 16, 2018. Answers (1)
- What is a cyber crime?(Solved)
What is a cyber crime?
Date posted: May 16, 2018. Answers (1)
- Describe the difference between an internal and an external hyperlink(Solved)
Describe the difference between an internal and an external hyperlink
Date posted: May 14, 2018. Answers (1)
- What’s the difference between encoding, encryption, and hashing?
(Solved)
What’s the difference between encoding, encryption, and hashing?
Date posted: May 13, 2018. Answers (1)
- Expand on Claude Shannon’s theorem. Differentiate the term confusion and diffusion as envisaged by Shannon to strengthen crypto-algorithm.(Solved)
Expand on Claude Shannon’s theorem. Differentiate the term confusion and diffusion as envisaged by Shannon to strengthen crypto-algorithm.
Date posted: May 13, 2018. Answers (1)
- In DES, the encryption and decryption algorithms are the same. Is that also the case in AES?(Solved)
In DES, the encryption and decryption algorithms are the same. Is that also the case in AES?
Date posted: May 13, 2018. Answers (1)
- What do we mean by public-key cryptography?(Solved)
What do we mean by public-key cryptography?
Date posted: May 13, 2018. Answers (1)
- What is a certificate and why are certificates needed in public key cryptography?(Solved)
What is a certificate and why are certificates needed in public key cryptography?
Date posted: May 13, 2018. Answers (1)
- Given this class fragment,
class samp {
double *p;
public:
samp (do d) {
p = (double *) malloc(sizeof(double));
if (!p) exit (1); //allocation error
*p = d;
}
~samp() {free(p) ;}
//...
}; ...(Solved)
Given this class fragment,
class samp {
double *p;
public:
samp (do d) {
p = (double *) malloc(sizeof(double));
if (!p) exit (1); //allocation error
*p = d;
}
~samp() {free(p) ;}
//...
};
//...
samp ob1(1, ob2(0.0);
//...
ob2 = ob1;
what problem is caused by the assignment of ob1 to ob2?
Date posted: May 12, 2018. Answers (1)
- To illustrate exactly when an object is constructed and destructed when returned from a function, create a C++ class called who. Have who's constructor take...(Solved)
To illustrate exactly when an object is constructed and destructed when returned from a function, create a C++ class called who. Have who's constructor take one character argument that will be used to identify an object.Have the constructor display a message similar to this when constructing an object:
Constructing who #X
where x is the identifying character associated with each object when an object is destroyed, have a message similar to this displayed:
Destroying who #x
where, again, x is the identifying character. Finally, create a function called make_who() that returns a who object. Give each object a unique name.Note the output displayed by the program.
Date posted: May 12, 2018. Answers (1)
- other than the incorrect freeing of dynamically allocated memory, think of a situation in which it would be improper to return an object from a...(Solved)
other than the incorrect freeing of dynamically allocated memory, think of a situation in which it would be improper to return an object from a function.
Date posted: May 12, 2018. Answers (1)
- As you know, when an object is passed to a function, a copy of that object is made.Further, when that function returns, the copy's destructor...(Solved)
As you know, when an object is passed to a function, a copy of that object is made.Further, when that function returns, the copy's destructor function is called.Keeping this in mind, what is wrong with the following program?
// This program contains an error.
#include
#include
using namespace std;
class dyna {
int *p;
public:
dyna(int i);
~dyna() { free(p); cout << "freeing \n"; }
int get() { return *p; }
};
dyna::dy*) malloc(sizeof(int));
if(!p) {
cout << "Allocation failure\";
exit(1);
}
*p = i;
}
// Return negative value of *ob.p
int neg(dyna ob)
{
retur.get();
}
int main()
{
dyna 0(-10);
cout << o.get() << "\n";
cout << neg(o) << "\n";
dyna o2(20);
cout << o2.get () << "\n";
cout << neg (o2)\n";
cout << o.get () << "\n";
cout << neg (o) << "\n";
return 0;
}
Date posted: May 12, 2018. Answers (1)
- If a queue dynamically allocates memory to hold the queue, explain the reason for that occurence and state whether in such a situation it...(Solved)
If a queue dynamically allocates memory to hold the queue, explain the reason for that occurence and state whether in such a situation it is possible to block one queue from being assigned to another.
Date posted: May 12, 2018. Answers (1)
- What is wrong with the following fragment?
//This program has an error.
#include
using namespace std;
class c11 {
int i, j;
public:
c11 (it a, int b) { i =...(Solved)
What is wrong with the following fragment?
//This program has an error.
#include
using namespace std;
class c11 {
int i, j;
public:
c11 (it a, int b) { i = a; j = b; }
// ...
};
class c12 {
int i; j;
public:
c12 (int a, int b) { i = a; j = b; }
// ...
};
int main()
{
c11 x(1c12 y(0, 0);
x = y;
// ...
}
Date posted: May 12, 2018. Answers (1)
- Given the following class, show how an object called ob that passes the value 100 to a and X to c would be declared
class sample...(Solved)
Given the following class, show how an object called ob that passes the value 100 to a and X to c would be declared
class sample {
int a;
char c;
public:
sample(int x, char ch) {a = x; c = ch;}
//...
};
Date posted: May 12, 2018. Answers (1)
- Given the following base class, show how it can be inherited by a derived class called mars
class planet {
int moons;
double dist_from_sun;
double diameter;
double mass
public:
// ...
};(Solved)
Given the following base class, show how it can be inherited by a derived class called mars
class planet {
int moons;
double dist_from_sun;
double diameter;
double mass
public:
// ...
};
Date posted: May 12, 2018. Answers (1)