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
Which plot element is typically the turning point in the most intense moment of a story
Valentin [98]

The climax. The climax is when the story peaks and has the most suspense. The story falls closer to it's end after the climax.

4 0
3 years ago
Read 2 more answers
Jacob develops a new app that will display the current weather centered on a user's location and notify the user in the case of
____ [38]

Answer:

C GIVE ME BRAINLEST

Explanation:

5 0
3 years ago
Read 2 more answers
3. Under which of the following categories does the artwork fall? ( 1 point )
Bumek [7]
Portrait is usually a painting of someone, still life is a very realistic drawing, monoprint is a print of an ex. leaf or other object.. its an ABSTRACT PAINTING
5 0
4 years ago
Read 2 more answers
A user program executes in a __________ , in which certain areas of memory are protected from the user's use, and in which certa
gtnhenbr [62]

Answer:

User Mode

Explanation:

Programs Can be Executed in two modes namely:

  • <em>User Mode</em>
  • <em>Kernel Mode</em>

User Mode

In User mode, the executing program has no ability to directly access hardware or reference memory. Program running in user mode must delegate to system APIs to access hardware or memory. Due to the protection afforded by this sort of isolation, crashes in user mode are always recoverable. Most of the program running on your computer will execute in user mode.

Kernel Mode

In Kernel mode, the executing program has complete and unrestricted access to the underlying hardware. It can execute any CPU instruction and reference any memory address. Kernel mode is generally reserved for the lowest-level, most trusted functions of the operating system. Crashes in kernel mode are catastrophic; they will halt the entire PC.

4 0
3 years ago
Image
Eduardwww [97]

Answer:

B. x = 90

Explanation:

  • 180 = 135 + y
  • y = 45
  • 45 + 45 = 90
5 0
3 years ago
Read 2 more answers
Other questions:
  • Laura is using studio lighting while photographing a model. The four elements that she will use in studio lighting are hot light
    10·1 answer
  • At what point is an idea protected by copyright?
    7·2 answers
  • List two ways that guest could be defined
    12·2 answers
  • 5. How can a budget prepare you to become financially secure?
    10·2 answers
  • Which color reflects more light red blue black or white
    6·1 answer
  • All wireless networks have their own name, referred to as the ________, which is used to identify the network.
    11·1 answer
  • Which of the following are parts of the Physical Layer?
    9·1 answer
  • Java: Programming Question: Reverse OrderWrite a program that reads ten integers into an array; define another array to save tho
    10·1 answer
  • 7. In order to check your following distance, use a fixed object and count seconds.
    5·2 answers
  • What is wrong with line 3 ?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!