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
ella [17]
2 years ago
13

Which line of code outputs the decimal portion of a float stored in the variable x? print (x % 1000) print (x) O print (x / 1000

) print (x - int(x))​
Computers and Technology
1 answer:
vlabodo [156]2 years ago
6 0

print(x - int(x))

int(x) will round the float down to the nearest whole number x - int(x) subtracts that rounded value from the original float. This will leave the remaining decimal portion.

I hope this helps!

You might be interested in
A painting company has determined that for every 115 square feet or wall space, one gallon of paint and eight hours of labor wil
Kay [80]

The program to calculate the total paint cost and other values is given below.

#include <iostream>

using namespace std;

int main() {  

 int rooms, laborChrg = 18;

 float paintChrg;

 float feetPerRoom[rooms];  

 float paintReq, laborHrs, paintCost, laborCost, totalCost, totalsqft=0;  

 cout<<"Enter the number of rooms to be painted "<<endl;

 cin>>rooms;  

 for(int i=0; i <= rooms; i++)

 {

 cout<<"Enter the square feet in room "<<endl;

 cin>>feetPerRoom[i];  

 // shortcut operator which is equivalent to totalsqft = totalsqft +     feetPerRoom[i];

 totalsqft += feetPerRoom[i];

 }  

 cout<<"Enter the cost of the paint per gallon "<<endl;

 cin>>paintChrg;  

 laborHrs = (totalsqft/115)*8;

 laborCost = laborHrs * laborChrg;  

 paintReq = totalsqft/115;

 paintCost = paintReq * paintChrg;  

 totalCost = laborCost + paintCost;  

 cout<<"The number of gallons of paint required "<<paintReq<<endl;

 cout<<"The hours of labor required "<<laborHrs<<endl;

 cout<<"The cost of the paint is "<<paintCost<<endl;

 cout<<"The labor charges are "<<laborHrs<<endl;

 cout<<"The Total cost of the paint job is "<<totalCost<<endl;  

 return 0;

}

Explanation:

The header files for input and output are imported.

#include <iostream>

using namespace std;

All the variables are taken as float except labour charge per hour and number of rooms.

The user is asked to input the number of rooms to be painted. An array holds the square feet in each room to be painted.

cout<<"Enter the number of rooms to be painted "<<endl;

cin>>rooms;  

for(int i=0; i <= rooms; i++)

{

cout<<"Enter the square feet in room "<<endl;

cin>>feetPerRoom[i];  

totalsqft += feetPerRoom[i];

}  

The above code asks for square feet in each room and calculates the total square feet to be painted simultaneously.

All the data to be displayed is calculated based on the values of labor charge per hour and gallons of paint needed, given in the question.

laborHrs = (totalsqft/115)*8;

laborCost = laborHrs * laborChrg;

paintReq = totalsqft/115;

paintCost = paintReq * paintChrg;

totalCost = laborCost + paintCost;

All the calculated values are displayed in the mentioned order.

7 0
3 years ago
Need answer ASAP
kaheart [24]

Answer:

D. To ensure that the software adheres to technical standards

Explanation:

The responsibility of the software architect is to ensure that all parts of the software system are able to meet the requirements set forth by the project or specifications, in this case, the technical standards.  This is an important piece of the software system because without it, the software system may not perform the necessary functions that it was written to do.

Cheers.

5 0
3 years ago
Smith, Smith, Smith, and Smith (S4) is a regional accounting firm will be moving to a new four-story building. There will two Lo
ICE Princess25 [194]

Answer:

Crosstalk, Jitter, Impulse noise.

Explanation:

Crosstalk is a network error that occurs when one pair of cable causes interference on another pair of cables thereby preventing efficient data transmission.

Jitter may also impair the accuracy of the data being transmitted across network because minute variations in amplitude, phase, and frequency always occur. The generation of a perfect carrier signal in an analog circuit is almost impossible. The signal may be affected by continuous and rapid network gains or phase changes.

Impulse noise (also referred to as spikes) is the primary source of errors in data communications.  Impulse noise can be caused by positioning a communications cable near a source of intermittent but strong electromagnetic pulses, such as an elevator motor.

Counter measures

Shielding (protecting wires by covering them with an insulating coating) is one of the best ways to prevent impulse noise, cross-talk.

Amplifiers can be used to increase signal strength since the connection would run across 4 floors.

5 0
3 years ago
Digital Sep <br> helps as reimagine outcomes true or false
iragen [17]

Answer:

true

Explanation:

mark me as brailyist pls

6 0
3 years ago
Desinated for a network connection within a largecity or multiple small citys
frozen [14]

I think it is WAN (Wide Area Network).

6 0
3 years ago
Other questions:
  • Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar tha
    6·1 answer
  • The instruction set for a microprocessor is unique and is typically understood only by the microprocessors of the same brand.
    7·1 answer
  • Sonora wants to extend the cells to be added in her formula. what is the quickest way to add more sells?
    10·2 answers
  • What is computer hacking? describe some examples
    6·1 answer
  • What is sun and what does it do?
    12·2 answers
  • Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
    12·1 answer
  • Exercise#3: Write a program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and th
    14·2 answers
  • When machining rotors, what is the reason for setting the indexing collars to zero?
    9·1 answer
  • Write an enhanced for loop that multiplies all elements in an int[] array named factors, accumulating the result in a variable n
    11·1 answer
  • Write a short note on Ms - Excel...​..
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!