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
PIT_PIT [208]
3 years ago
12

(Rounding Numbers) An application of function floor is rounding a value to the nearest

Computers and Technology
1 answer:
Whitepunk [10]3 years ago
7 0

Answer:

Following are the program in the C++ Programming Language.

//header file

#include <iostream>

//header file for floor function

#include<math.h>

//using namespace

using namespace std;

//define main function

int main() {

 //set and initialize float type variable and value

 float a=12.3, c=1.45, d=165.345;

 //initialize it in other variable

 float x=a;

 //set float variable to store floor value

 float y=floor(x+5);

 //display output with message

 cout<<"before "<<x<<" and after the floor "<<y<<endl;

 //set float variable to store floor value

 y=floor(c+5);

 //display output with message

 cout<<"before "<<c<<" and after the floor "<<y<<endl;

 //set float variable to store floor value

 y=floor(d+5);

 //display output with message

 cout<<"before "<<d<<" and after the floor "<<y;

}

Output:

before 12.3 and after the floor 17

before 1.45 and after the floor 6

before 165.345 and after the floor 170

Explanation:

Here, we define the "main()" function and inside the main function.

  • Set and initialize three float data type variables "a", "c", "d" to 12.3, 1.45, 165.345.
  • Set the float data type variable "x" to store the value of the variable "a"
  • Again set float type variable "y" to store the floor value.
  • Then, Print message and output of the variable.
  • Again we repeat point 3 and 4 two times.
You might be interested in
What determines gravitational pull?<br><br> volume<br><br> mass<br><br> the sun<br><br> acceleration
Arte-miy333 [17]
C. The sun is correct!
8 0
3 years ago
Read 2 more answers
If a hacker can steal your passwords by installing malware that captures all the messages you type, what kind of malware did the
Free_Kalibri [48]
Keylogger, or Spyware
4 0
3 years ago
Read 2 more answers
Any device that performs single conversion is ____​
andrew-mc [135]

Answer:

modulator

Explanation:

A modulator is a device that performs modulation.

(Single conversation)

5 0
3 years ago
Renée’s job entails using a company laptop to constantly open other peoples’ workbooks, sorting the data, importing a new sheet
nevsk [136]

she should leave and go somewhere else for a mminute to cool and then come backa nd close tabs.

6 0
3 years ago
PHP Create a for loop that initialize with the variable $i = 10 The loop outputs $i as long as $i is greater than 1 using for lo
Tanzania [10]

Answer:

The PHP code is as follows

<?php

for ($i = 10; $i>1; $i--)

{

echo $i.' ';

}

?>

Explanation:

The code is self explanatory and doesn't require comments before it can easily understood.

The program starts with a php opening tag <?php

And it ends with the closing tag ?>

The interpretation of the question is to print integer values from 10 to 1

To do this, an iteration is needed.

The above program makes use of a for loop iteration.

Analysis;

for ( -> This shows that it is a for loop iteration

$i = 10; -> Iterating variable $i is initialized to 10 (that is; printing will start at 10)

$i>1; -> Iteration is valid while $i is greater than 1 (e.g. 2,3,4...10)

$i-- -> For every Iteration, decrease $i by 1

) -> End of Iterating condition

echo $i.' '; -> This line prints the valid values of $i. In this case, the values of $i is from 10 and stops at 2

The output is as follows

10 9 8 7 6 5 4 3 2

4 0
3 years ago
Other questions:
  • Once Raul selects a technology solution, he has completed the process. <br> a. True<br> b. False
    13·2 answers
  • Discuss anomaly detection.
    5·1 answer
  • Write a definition of the function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    14·1 answer
  • The __________ assumption necessary for a linear programming model to be appropriate means that the contribution to the objectiv
    6·1 answer
  • Which statement is correct? a. choice of metric will influence the shape of the clusters b. choice of initial centroids will inf
    12·1 answer
  • Describe the procedure for creating a table or spreadsheet in a presentation slide.
    13·1 answer
  • Which task can a company perform with intranets
    8·1 answer
  • You press the F9 key to convert an object to a symbol true or false​
    12·1 answer
  • What’s Discord Packing?
    8·2 answers
  • HELP FAST PLS<br> Do you care more about avoiding fees/costs, accumulating perks, convenience, etc?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!