Current Precision - Computers and Programming I - Home Work, Lecture notes of Computer Programming

Some concept of Computers and Programming I are Assign Value, Single-Subscripted Array, Class Members, Current Precision, Elementary School, Complete Program, Fibonacci Sequence, Programming Errors. Main points of this homework are: Current Precision, Single Statement, Performs, Member Function, Current Precision, Digits, Precision, Manipulator, Hexadecimal, Decimal

Typology: Lecture notes

2012/2013

Uploaded on 04/27/2013

kid
kid 🇮🇳

4.3

(18)

110 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
For each of the following, write a single statement that performs the
indicated task.
Question 1
Print the current precision setting using a member function.
Question 2
Print 1.92, 1.25 and 1.9258 with 3 digits of precision using a manipulator
Question 3
Print integer 100 in octal, hexadecimal and decimal using stream
manipulators.
Question 4
Print integer 100 in decimal, octal, and hexadecimal using a single stream
manipulator to change the base.
Question 5
Print 1234 right-justified in a 10-digit field.
Question 6
Using integer variables x and y to specify the field width and precision used
to display the double value 87.4573 and display the value.
Question 7
Write a program to test inputting integer values in decimal, octal and
hexadecimal format. Output each integer read by the program in all three
formats. Test the program with the following input data: 10, 010, 0X10.
pf3

Partial preview of the text

Download Current Precision - Computers and Programming I - Home Work and more Lecture notes Computer Programming in PDF only on Docsity!

For each of the following, write a single statement that performs the indicated task.

Question 1 Print the current precision setting using a member function.

Question 2 Print 1.92, 1.25 and 1.9258 with 3 digits of precision using a manipulator

Question 3 Print integer 100 in octal, hexadecimal and decimal using stream manipulators.

Question 4 Print integer 100 in decimal, octal, and hexadecimal using a single stream manipulator to change the base.

Question 5 Print 1234 right-justified in a 10-digit field.

Question 6 Using integer variables x and y to specify the field width and precision used to display the double value 87.4573 and display the value.

Question 7 Write a program to test inputting integer values in decimal, octal and hexadecimal format. Output each integer read by the program in all three formats. Test the program with the following input data: 10, 010, 0X10.

  • Question