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
Choose the types of education an ISS professional
Viefleur [7K]

Answer:

It's A. a CompTIA certificate and D. a Microsoft-certified desktop support

certificate

Explanation:

I got it right.

7 0
3 years ago
A group of users can perform certain operations on a shared workbook. Which option helps them to update and track changes in the
irina1246 [14]

The “Allow changes by more than one user at the same time” option.


In a group of users, it is very important to create a shared workbook so that several people are able to update information and track changes in the workbook at the same time. To do so, one should click on the review tab of the excel sheet and select share workbook. On the editing tab of the share workbook dialog box, select the Allow changes by more than one user at the same time check box. Go ahead and click the advanced tab and select option you would want to use and then click OK

 






4 0
3 years ago
When should you use the Reply All function when replying to an email
Dmitrij [34]
When the email was sent as a group email 

5 0
3 years ago
Read 2 more answers
My brainly is no hello friend , i need you can you help me, please okay
Pachacha [2.7K]

Answer:

I'll try to help you!

what do you need?

Explanation:

I hope you have an amazing day!

✧◝(⁰▿⁰)◜✧

8 0
2 years ago
Read 2 more answers
How is the Internet Simulator similar to the Actual Internet? How is it different?
masya89 [10]
The Internet Simulator is a tool developed by Code.org for our new high school Computer Science Principles class. ... The Internet Simulator was designed to be used in a classroom with students working collaboratively in-person to solve problems.
4 0
3 years ago
Other questions:
  • You have been contracted by a local school to evaluate their computer labs for security threats. They are most worried about the
    6·1 answer
  • Effective note-taking helps support<br><br> action.<br> distinction.<br> distraction.<br> retention.
    9·2 answers
  • Routing connects different network segments and decides where __________are sent to
    7·1 answer
  • In modern web design, color, font, font size, and style should be declared using:
    5·1 answer
  • Which key is used to indent the first line of a paragraph to the right?
    15·2 answers
  • When specifying keywords to conduct an internet search, which of the following parts of speech will be the most useful??
    6·1 answer
  • A user contacted the help desk to report that the laser printer in his department is wrinkling the paper when printed. The user
    5·1 answer
  • When troubleshooting firewalls, you should never attempt to repeat the problem because you could do more damage. T/F
    6·1 answer
  • ____ is one of the primary operations of a computer.
    10·1 answer
  • What does it mean to catch an exception?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!