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 of these is unused normal, unvisited link ??
Tomtit [17]

Answer:

hover

Explanation:

hope my answer help you

8 0
3 years ago
Explain how a message is transmitted from one computer to another using layers.
nevsk [136]
I need some answer chouices but they use iphones
7 0
3 years ago
A(n) ________ is a heavily secured server located between a company's secure internal network and its firewall. bastion host tra
devlian [24]

Answer: Bastion host

Explanation: Bastion host is type of computer which resist the attacks happening on a network particularly. It mostly works between the internet and interior network. It assures that the interior computer network remains undamaged due to any type of threat. It can also be considered that bastion host behave as the gateway between internal network and firewall as well.

4 0
3 years ago
Melissa just bought a new entertainment system for her apartment. It includes a flat-screen TV, surround-sound speakers, and a v
harkovskaia [24]

She should get personal property insurance

4 0
3 years ago
Read 2 more answers
What is one of the main sustainability benefits of using large-scale, cloud computing data centers?
uysha [10]

Cloud computing allows for large chunks of data to be stored in data centers with owners having the ability to access stored information from any devices or location using their login credentials ensuring information are safe, secure and available over a an infinitely long period of time.

  1. Sustainability involves keeping hold of something over a very long period of time.

  • When data or information are saved on online data centers which is made possible by cloud computing. Cloud computing ensures that data isn't saved on an individual's personal memory storage such as local hard drive or memory Cards where it could be lost at anytime.

  • Data is stored online in data centers where it can be accessed over a very long period of time.

Therefore, the ability to get hold of time long information is an essential and important sustainability benefit offered by cloud computing.

Learn more :brainly.com/question/24875533

8 0
3 years ago
Other questions:
  • What will be the output of the following Python code? class A: def test1(self): print(" test of A called ") class B(A): def test
    15·1 answer
  • If 10 ft lb of torque is applied at gear A, then what is the output torque at gear D?
    15·1 answer
  • Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
    15·2 answers
  • General equation: y = (89 / 27) - z * x + a / (a % 2) (recall: a is an integer; the 89 and 27 constants in the equation should b
    14·1 answer
  • . Suppose that name is a variable of type string. Write the input statement to read and store the input Brenda Clinton in name
    5·1 answer
  • An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
    14·1 answer
  • What is a good coding site
    10·1 answer
  • You are utilizing BitLocker Drive Encryption, and are attempting to update Windows Server 2016. What must be done so that the up
    14·1 answer
  • To simplify the conceptual design, most higher-order relationships are decomposed into appropriate equivalent _____ relationship
    11·1 answer
  • How can the system administrator give the executive assistant the ability to view, edit, and transfer ownership of all records,
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!