Click here to Skip to main content
       

C / C++ / MFC

 
QuestionWhy does so many companies use directUI to show GUI ? Pingroupyu-jian20-Feb-13 15:09 
QuestionCFileDialog in Dll Project PinmemberLeeUnSong20-Feb-13 14:38 
AnswerRe: CFileDialog in Dll Project PinmvpRichard MacCutchan20-Feb-13 21:10 
GeneralRe: CFileDialog in Dll Project PinmemberLeeUnSong21-Feb-13 0:31 
GeneralRe: CFileDialog in Dll Project PinmvpRichard MacCutchan21-Feb-13 1:16 
QuestionFormatting Output [modified] PinmemberSarah Trattner20-Feb-13 12:02 
AnswerRe: Formatting Output PinmemberGarth J Lancaster20-Feb-13 12:33 
GeneralRe: Formatting Output PinmemberSarah Trattner20-Feb-13 13:00 
Thank you this is what I was asking, just a start because I have litterally never written code in C++ only pseudocode. I am just trying to put together how each line will appear. He provided the entire program we have to fill in our solution. Here, I'll show you...
 
Exercise 3:
Objectives: using the iomanip library to format screen output.
 
Complete the provided main() program with statements to accomplish each of the following. In each case you must use the appropriate I/O stream manipulators to produce the appropriate output wherever possible. Refer to the sample output below as a guide for proper output alignment.
 
Output first first as an integer value, followed by a space, then in its written form.
Output second as a base ten value, followed by a space, then as a hexadecimal value, followed by a space, then as an octal value. Make sure the appropriate base indicator prefix is shown in the output.
Output third.
Output fourth with four digits, with the sign shown at the left, and the value right aligned. The decimal point must also appear.
Output fourth with four significant figures.
Output fifth with seven significant figures. (Must be left-aligned)
Output fifth with three digits to the right of the decimal point.
Output third.
Output fourth with two digits to the right of the decimal point.
Output sixth with no decimal portion showing
Output fourth with eight digits to the right of the decimal point.
Output sixth with six digits.
You must start your coding by using exactly the following program. You may not modify it, except to add the required code between the Solution starts, and Solution ends comments.
 
#include <iostream>
#include <iomanip>
using namespace std;
int
main()
{
bool first;
int second;
long third;
float fourth;
float fifth;
double sixth;
 
cout << "Enter bool, int, long, float, float, and double values: ";
cin >> first >> second >> third >> fourth >> fifth >> sixth;
cout << endl;
 
// ***** Solution starts here ****
 
// ***** Solution ends here ****
 
cin.get();
return 0;
}
SAMPLE PROGRAM OUTPUT (assume user inputs values shown in bold):
Enter bool, int, long, float, float, and double values:
1 69 1464878 6443.39 -7.273 -6443.39
1 true
69 0x45 0105
1464878
+ 6443.
6.4434e+03
-7.2729998e+00
-7.273
1464878
6443.39
-6443
6443.39013672
-6443.39
GeneralRe: Formatting Output PinmemberGarth J Lancaster20-Feb-13 13:26 
GeneralRe: Formatting Output PinmemberGarth J Lancaster20-Feb-13 13:37 
QuestionBOM Code PinmvpMichael Haephrati מיכאל האפרתי20-Feb-13 10:41 
SuggestionRe: BOM Code PinmemberDavidCrow20-Feb-13 10:47 
GeneralRe: BOM Code PinmvpMichael Haephrati מיכאל האפרתי20-Feb-13 10:49 
QuestionOn displaying two images second image overlapps first image Pinmembertoms from newdelhi20-Feb-13 0:32 
AnswerRe: On displaying two images second image overlapps first image PinmvpRichard MacCutchan20-Feb-13 2:40 
AnswerRe: On displaying two images second image overlapps first image PinmvpMichael Haephrati מיכאל האפרתי20-Feb-13 10:15 
QuestionCFileDialog with preview working in Xp but not in Win7 Pinmemberyogeshs19-Feb-13 18:50 
AnswerRe: CFileDialog with preview working in Xp but not in Win7 PinmvpRichard MacCutchan19-Feb-13 22:10 
GeneralRe: CFileDialog with preview working in Xp but not in Win7 Pinmemberyogeshs19-Feb-13 22:46 
GeneralRe: CFileDialog with preview working in Xp but not in Win7 PinmvpRichard MacCutchan19-Feb-13 23:01 
GeneralRe: CFileDialog with preview working in Xp but not in Win7 Pinmemberyogeshs20-Feb-13 18:46 
GeneralRe: CFileDialog with preview working in Xp but not in Win7 PinmvpRichard MacCutchan20-Feb-13 21:06 
QuestionProblem Reading/Writing Registry in Windows 7? PinmemberMember 919975419-Feb-13 9:40 
AnswerRe: Problem Reading/Writing Registry in Windows 7? PinmemberDavidCrow19-Feb-13 9:50 
GeneralRe: Problem Reading/Writing Registry in Windows 7? PinmemberMember 919975419-Feb-13 13:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 19 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid