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]
4 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]4 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 term refers to a fact that naturally occurs in the universe?
MrMuchimi

Answer: a scientific law

Explanation:

8 0
3 years ago
Read 2 more answers
Word wrap is the same as __________ return and means you let the ______________ control when it will go to a new line.
dusya [7]

Word wrap is the same as; Soft Return

Word wrap means that you let the; Computer Control when it will go to a new line

<h3>What is Text Wrapping?</h3>

Text wrapping is simply defined as a process used in MS Word to Wrap a Text around an Image.

Now, the way it is done is by selecting the image you want to wrap text around and then On the Format tab, click the Wrap Text command in the Arrange group, then select the desired text wrapping option to wrap the text.

Finally Word wrap is also same as using soft return and letting the computer control when it goes to the next line.

Read more about text wrapping at; brainly.com/question/5625271

5 0
2 years ago
A file is to be shared among different processes, each of which has a unique number. The file can be accessed simultaneously by
UkoKoshka [18]

Answer:

monitor fileSharer

{

       enum {THINKING, WAITING, READING} state[N];

       condition self[N];

       int total;

       void open(int i) {

               state[i] = WAITING;

               if (i + total >= N)

               { self[i].wait(); }  // Leaves monitor

               state[i] = READING;

               total += i;

       }

       void close(int i) {

               state[i] = THINKING;

               total -= i;

               // Can signal one waiting proc whose ID won't break bank.

               for (int x = N - total - 1; x >= 0; x--) {

                       if (state[x] == WAITING) {

                               self[x].signal(); break;

                       }

               }

       }

       initialization.code() {

               for (int i = 0; i < N; i++) {

                       state[i] = THINKING;

               }

               total = 0;

       }

}

8 0
4 years ago
When using a direct quotation, which one of the following is not necessary?
ss7ja [257]

Answer:

B

Explanation:

You can't rewrite a source with the writers voice. that makes no sense

6 0
4 years ago
Write a program that prompt the user to enter a bank balance. The balance entered by the user is read into a variable named bala
IRINA_888 [86]

Answer:

ertyuiopoijuhgfdsa hiyoufun tresdfghytrefgytredfg

Explanation:

look for the words

4 0
3 years ago
Other questions:
  • In Rizzati Corp, vice presidents in departments such as engineering, manufacturing, IT, and human resources report directly to t
    15·1 answer
  • If a user has one column in a table and would like to make it into two columns which command should be used?
    8·2 answers
  • List 7 basic internal component found in a computer tower?
    11·2 answers
  • Name the written test a potential driver must pass and list the minimum required score to earn a learner’s license.
    8·2 answers
  • The amount of RAM storage is measured in A: GB The rule of thumb that predicts that CPU capacity will double every 2 years is ca
    11·1 answer
  • Being able to express your thoughts in an email is a primary technology skill. true or false.
    9·2 answers
  • The keys to successful outsourcing are accountability, reporting, and ___
    7·1 answer
  • What is a common practice that enterprise organizations will implement to ensure the users of a network and a Mobile Device Mana
    12·1 answer
  • This type of headline sits next to a story.<br> Banner<br> Slammer<br> Hammer<br> Sidesaddle
    8·2 answers
  • Your data warehousing project group is debating whether to create a prototype of a data warehouse before its implementation. The
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!