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]
3 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]3 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
Suppose we have a 4096 byte byte-addressable memory that is 32-way high-order interleaved, what is the size of the memory addres
iogann1982 [59]

Answer:

7

Explanation:

Given that :

Byte-addressable memory = 4096

Order = 32

Rwqritying such that they have the same base ;

4096 = 2^12

32 = 2^5

2^12 - 2^5

12 - 5 = 7

4 0
3 years ago
What should you do with a wireless-capable laptop if you connect a lan cable to it?
marusya05 [52]
A local-area network (LAN<span>)  cable is used in LAN networks to connect several computers or other networking devices.</span>
If you connect a LAN cable to a wireless-capable laptop you should turn the wireless capability off to maximize security, because through the LAN cable viruses can be transmitted, than can harm your computer.

6 0
3 years ago
Read 2 more answers
Select all phrases that describe a server-based network. centralized network security easy to expand log-ins controlled by centr
slamgirl [31]

Answer:

Client Server Network ... is the central computer that enables authorized users to access networked resources ... computers in this type of network are connected to a central hub ... why might a business choose a server based network (3) ... 2) easier to expand ... external hardware connected to and controlled by a computer.

Explanation:

8 0
3 years ago
Read 2 more answers
How is the central message of being true to oneself conveyed in the story?
Natali5045456 [20]

The central message of being true to oneself is illustrated in the story as the character allowed his uniqueness to shine through.

You did not provide the story. Therefore, an overview of the central idea will be given. The central message of a story is the main idea that the author wants the readers to know.

The central message is also referred to as the theme. Since the central message is about being true to oneself, the character will respect the opinions of others but won't conform to stereotypes. Such a person allows their uniqueness to shine through.

Read related link on:

brainly.com/question/25582903

8 0
3 years ago
What does aerodynamics mean?
murzikaleks [220]
Having a shape that reduces the drag from the air moving past.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Select the tips you should follow when creating a newsletter.
    13·1 answer
  • What IEEE 802.11 wireless standard supports devices only in the 5GHz range with speeds up to 4.9Gb/s because of accepting data f
    12·1 answer
  • What are the 4-bit patterns used to represent each of the characters in the string "1301"? Only represent the characters between
    14·1 answer
  • If a user inserts a piece of clip art over some text but does not want the art to block the text, the user should select
    14·2 answers
  • . What is suboptimization?
    6·1 answer
  • How do you keep word from trying to capitalize every isolated letter "i"
    15·2 answers
  • Who doesn't like reeses
    11·2 answers
  • Which sentence indicates that Jeff is mentioning the visual synopsis in his proposal while planning a media project?
    10·1 answer
  • What is computer forensics? Where and how would an IT auditor use thisresource?
    12·1 answer
  • Which of these agents of education empowers the other..........
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!