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
Which wireless technology connects with most mobile devices?
LenaWriter [7]

Answer:

¡) Internet

¡¡) Alexa

¡¡¡) Electronic Devices

8 0
2 years ago
How many degrees of freedom does any unconstrained object have in 3-D modeling?
Free_Kalibri [48]
I think its 6 degrees

3 0
3 years ago
The navigation bar appears in the same position on each page and uses the same colors, fonts, and font styles.
Ivan

Answer:

true

Explanation:

I think that's what it has been in my time of classes

3 0
2 years ago
HTML5 is______because it works on tablet or smartphone,notebooks
jeyben [28]

Answer:

Wonderful and easy language

Explanation:

Hope this helps

3 0
3 years ago
Read 2 more answers
Ken Olson, president of Digital Equipment Corp. in the late 1970's, Thomas J. Watson, chairman of IBM in the early 1940's, and T
tensa zangetsu [6.8K]

Answer:

All of the above is the correct answer to the given question .

Explanation:

As the Ken olson is the Ken Olson, president of the Digital Equipment Organization . Following are the predictions of  Ken olson of the the technology that are wrong.

  • Lack of creativity regarding the current applications that the user has would consider for the  technology.
  • Lack of creativity regarding the  user or the client has liking.
  • Lack of creativity on what the government would be charging ford. Any of these

So we will choose the Option all these.

8 0
3 years ago
Other questions:
  • When a browser makes a request for a static web page, the web server a. finds the HTML for the page and renders it b. renders th
    11·1 answer
  • Jeffrey works with a huge database of spreadsheet records each day. To organize and identify these spreadsheets, he wants to ass
    8·1 answer
  • In reduced visibility conditions you need to work especially hard to gather visual information because
    7·1 answer
  • What are candid shots? what are posed shots?
    13·1 answer
  • What is the difference between MySQL and MariaDB?
    9·1 answer
  • I need help!! I decided to go back to college this year and am taking Intro to Logic and Programming. I have an assignment due t
    5·1 answer
  • What can you think of as a box or container that holds a value and has a label?
    11·2 answers
  • Which of the following is NOT a common grammar adjustment which is identified by grammar-check software?
    6·1 answer
  • What role does the automated surface observing system.
    5·2 answers
  • How can i find these services
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!