is program illustrates the how the showpoint, setpre d fixed manipulators operate both individually and w ude // Header file needed to use str ude E namespace std; in program ain() ouble x = 6.0;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Step 5)
// This program illustrates the how the showpoint, setprecision,
// and fixed manipulators operate both individually and when used together.
#include <iostream>
#include <iomanip>
using namespace std;
// Header file needed to use stream manipulators
// main program
int main()
{
double x =
6.0;
cout <« x << endl;
cout <« showpoint <« x << endl;
cout <« setprecision(2) <« x « endl;
cout <« fixed <« x « endl;
return 0;
}
EXPECTED OUTPUTS:
OBSERVED:
Transcribed Image Text:Step 5) // This program illustrates the how the showpoint, setprecision, // and fixed manipulators operate both individually and when used together. #include <iostream> #include <iomanip> using namespace std; // Header file needed to use stream manipulators // main program int main() { double x = 6.0; cout <« x << endl; cout <« showpoint <« x << endl; cout <« setprecision(2) <« x « endl; cout <« fixed <« x « endl; return 0; } EXPECTED OUTPUTS: OBSERVED:
Step 4) For each of these codes, write the expected outputs on your paper, and then run
the code and compare your answers.
// This program uses setw to display three rows of numbers so they align.
#include <iostream>
#include <iomanip>
using namespace std;
// Header file needed to use setw
// main program
int main()
{
837,
num6 = 1623,
int num1
num3 =
2897, num2 = 5,
num5 = 7,
num7 = 390, num8 = 3456, num9 = 12;
%3D
num4 = 34,
// Display the first row of numbers
cout <« setw(6) « num1 << setw(6) <« num2 <« setw(6) << num3 << endl;
// Display the second row of numbers
cout <« setw(6) « num4 << setw(6) « num5 « setw(6) <« num6 << endl;
// Display the third row of numbers
cout <« setw(6) « num7 << setw(6) « num8 « setw(6) << num9 << endl;
return 0;
}
Transcribed Image Text:Step 4) For each of these codes, write the expected outputs on your paper, and then run the code and compare your answers. // This program uses setw to display three rows of numbers so they align. #include <iostream> #include <iomanip> using namespace std; // Header file needed to use setw // main program int main() { 837, num6 = 1623, int num1 num3 = 2897, num2 = 5, num5 = 7, num7 = 390, num8 = 3456, num9 = 12; %3D num4 = 34, // Display the first row of numbers cout <« setw(6) « num1 << setw(6) <« num2 <« setw(6) << num3 << endl; // Display the second row of numbers cout <« setw(6) « num4 << setw(6) « num5 « setw(6) <« num6 << endl; // Display the third row of numbers cout <« setw(6) « num7 << setw(6) « num8 « setw(6) << num9 << endl; return 0; }
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education