Answer:
The C++ code is given below with appropriate comments
Explanation:
//Remove this header file if not using visual studio.
#include "stdafx.h"
//Include the required header files.
#include <iostream>
//Use for maths function.
#include <cmath>
using namespace std;
//Define main function
int main()
{
// Define the variables
double targetValue = 0.3333;
double sensorReading = 0.0;
//Perform the opeartion.
sensorReading = 1.0 / 3.0;
// Get the absolute floating point value and
// Check up to 4 digits.
if (fabs(sensorReading - targetValue) < 1E-4)
{
//Print equal if the values are close enough.
cout << "Equal" << endl;
}
else
{
//Print not equal if the values are not
//close enough.
cout << "Not equal" << endl;
}
system("pause");
//Return the value 0.
return 0;
}
8. according to Google, 1 byte = 8 bits
Answer:
Explanation:
Duplicate tuples are not allowed in a relation because the specifications of the constraints of the regional integrity are violated, especially the main constraint that states that there can be no identical values for the attributes of two tuples at any database relation state.
Also, duplicate tuples are not allowed in a relation due to the fact that they lead to redundancy of the data base which in turn, slowing down the speed of the database when data processing such as inserting, querying, updating, deleting, etc are being performed.