1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Basile [38]
3 years ago
9

Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targe

tValue. Otherwise, print "Not equal". Ex: If targetValue is 0.3333 and sensorReading is (1.0/3.0), output is: Equal
Computers and Technology
1 answer:
natali 33 [55]3 years ago
5 0

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;

}

You might be interested in
Which of these allows the programmer to put data inside a variable?
gregori [183]

Answer:

it's the equal sign "="

5 0
2 years ago
To differentiate the absolute pathnames to files that are located on different drives, html requires you to include the drive le
Ber [7]
<span>To differentiate the absolute pathnames to files that are located on different drives, HTML requires you to include the drive letter followed by a </span>vertical bar.
4 0
3 years ago
What does SIP stand for?
agasfer [191]
Session Initiation Protocol, brainliest ?
4 0
3 years ago
Read 2 more answers
A ____ is a key-dependent, one-way hash function that allows only specific recipients(symmetric key holders) to access the messa
Alexxx [7]

Answer: (C) MAC

Explanation:

MAC is stand for the message authentication code and it is one of the key dependent hash function. Message authentication provide the data integrity and also the origin of data authentication.

  • It basically allow the specific recipients known as the holder of the symmetric key.
  • The message authentication code uses the CBC (Cipher block chaining) mode for constructing the MAC algorithm and it also uses the block cipher for the conjunction by using the CBC operations.    

On the other hand, all the options are incorrect as they are not the key dependent hash function.

Therefore, Option (C) is correct.

7 0
3 years ago
Does an android tablet have a hard drive
Kisachek [45]
No, it uses flash menory
3 0
3 years ago
Other questions:
  • Why do clocks tick-toc?
    5·2 answers
  • HELP ASAP!!!
    11·2 answers
  • ____ includes any attempt to intentionally conduct dishonest activities online.
    5·1 answer
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • Random Walker Collisions In lecture, we saw how to model the behavior of a random walker on a 2D grid using a Monte Carlo simula
    8·1 answer
  • PLEASE HELP!! WILL MARK BRAINLIEST!!
    9·1 answer
  • The most common clefs for high notes are what?
    6·2 answers
  • Dr. Wayne is trying to developing techniques to cure Parkinson’s disease by inserting genetic material into patients’ cells to c
    12·1 answer
  • Need help finding the totals and with the empty spots
    9·1 answer
  • What should you do if an online friend asked to meet you after school? <br>ᵖˡˢˢˢˢ...​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!