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 best describes color blindness?
lys-0071 [83]

What are the options?

If there are none...

MONOCHROMATIC would be your answer.

5 0
3 years ago
Constantine forms the following hypothesis. Let n be any non-negative number that meets the following condition: when n is divid
notka56 [123]

Answer:

n=5

Explanation:

if n= 5

i.     n/5=5/5=1  so it divides completely the remainder is 0

ii.  97 - 6(5) = 97 - 30 = 67,   67 is a prime number.

8 0
3 years ago
In which of the following situations should you expect to provide your Social Security number?
sveta [45]
Hey there!

Some situations you'd need to provide your SSN include when applying for insurance through an insurance company, when applying for a loan or a credit card (or any other company that you're sending a credit application to), banks, investment advisors, and cash transactions over $10,000, such as when buying a car. Also, if you are going to college with financial aid, colleges will collect your SSN. If any other business requests your SSN, they are legally allowed to, however, it's optional. It's also optional when applying for a job at a company, but might affect your chances at getting the job depending on the employer who may want to get credit statistics on their potential employees. 

Hope this helped you out! :-)
7 0
2 years ago
Terri needs to insert a cover page into her document. Where should she go to access the commands to do so? Insert tab, Objects g
dexar [7]

Answer:

Insert tab, Pages group

Explanation:

It just be like dat

7 0
1 year ago
SOMEONE HELP PLEASE ​
exis [7]
Do what?? please tell me
3 0
2 years ago
Other questions:
  • Match the items.
    15·1 answer
  • PLEASE HELP ME ON THIS..............PLEASEEEEEEEEEEEE PLEASEEEEEE<br><br> ITTS EASYYYYYYYY
    12·1 answer
  • When projecting a presentation on a large screen, what should your minimum font size be?
    6·2 answers
  • How do i do a class in java??
    5·1 answer
  • Two of the major sources used today for obtaining information to create computer maps are satellites and _____________.
    11·2 answers
  • Misperceptions can lead to miscommunication. List an example from the article.(site 1)
    10·2 answers
  • Create a dictionary password cracker or a brute force
    13·1 answer
  • The people, procedures, hardware, software, data, and knowledge needed to develop computer systems and machines that can simulat
    13·1 answer
  • Write an alogorithm and draw the Flow Chart to
    5·1 answer
  • Kenny is asked to submit a photo for the annual photographic competition. He decided to capture a photo with the light-painting
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!