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
Step2247 [10]
2 years ago
13

In C++ write a program that prints out PI as a type double and a type float EXACTLY as shown below. Your program should have ONE

cout statement within a loop which alters the width and precision each time through the loop. Do not write 10 separate cout statements for this problem. Show the output in a table that increases the precision from 1 to 10 as shown below. Use dash ('-') as the fill character. Note the differences as the precision gets larger.
Use the following two variables for PI.

double PI_D = 3.14159256359;
float PI_F = 3.14159256359;
Computers and Technology
1 answer:
victus00 [196]2 years ago
3 0

Answer:

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

double PI_D = 3.14159256359;

float PI_F = 3.14159256359;

cout<<"i"<<"\t\t"<<"Float"<<"\t\t"<<"Double"<<endl;

for(int i = 1; i<=10;i++)

{

 cout<<i<<"-\t\t"<<PI_F<<setprecision(i)<<"-\t\t"<<PI_D<<setprecision(i)<<endl;

}

 return 0;

}

Explanation:

See Attachment where I used comments for explanation

Download cpp
You might be interested in
What do these two parts of the lift do?​
sashaice [31]

Answer:

The Big Bang Theory is our best guess about how the universe began. A 2013 map of the background radiation left over from the Big Bang, taken by the ESA's Planck spacecraft, captured the oldest light in the universe. This information helps astronomers determine the age of the universe. ... The "Big Bang Theory" TV show.

7 0
3 years ago
Suppose a file system can have three disk allocation strategies, contiguous, linked, and indexed. We have just read the informat
otez555 [7]

Answer:

Since we are using three disk allocation strategies,continuous linked and indexed,therof to process and read allocation strategies we need 99830 disk blocks.

6 0
3 years ago
Busca información (nombre, potencia y situación) de los parques eólicos de la Comunidad Valenciana. con más de 40 MW de potencia
Colt1911 [192]
I need this answer too can someone please help us out with the right answer ?!

Explanation:
6 0
2 years ago
A wide-angle lens corrected for barrel distortion is called a(n)<br> lens.
Sonja [21]

Answer:

Rectilinear lens

Explanation:

In photography, the distortions are caused in the formation of the image due to either the position of the camera or the optical design of the lenses i.e perspective and optical distortion.

The barrel distortion is a type of optical distortion caused due to the optical design of the lens. In barrel distortion, the straight lines of the light bend as a result of which the lines appear curved inwards in images.  

The field of view of wider than the image sensor in barrel distortions which can be corrected by the use of rectilinear lens which provides straight lines without bending them. This lens stretches the image towards the edge and removes distortion.

Thus, Rectilinear lens is the correct answer.

3 0
2 years ago
Ballet was originally created for the wedding celebration of Louis XVI and Marie Antoinette. (True or False)
erastova [34]

Answer:

true

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • A user reports his or her computer is slow to boot. You check the boot order and determine that the computer is checking the C d
    12·1 answer
  • "Memory refers to: A.the brain processes involved in the encoding, storage, and retrieval of information. B.the mechanisms drivi
    9·1 answer
  • Taylor volunteered as a computer support specialist for his university's online library. Which part of his resume should include
    10·2 answers
  • When it comes to collecting and organizing prospect and account​ information, salespeople have a large variety of computer syste
    15·1 answer
  • Which of the following is an advantage of batch processing?
    8·1 answer
  • A news company is planning to use a Hardware Security Module (CloudHSM) in AWS for secure key storage of their web applications.
    14·1 answer
  • 23. What is the value of 3 - (4 + 2 *3)/(8-2) + 7 * 2+4
    7·1 answer
  • How do I make someone "Brainiest". <br> First person to reply will get "Brainiest"
    8·2 answers
  • Which information can you apply to every page of your document with the page layout options?
    9·1 answer
  • In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multip
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!