C++ simple program

Pls. help me on this, this is my first time in C++ and we are ask to do a program that automatically generate a user's biodata based on his/her inputted information.

Screen Output I
(Data Entry)


Screen Output 2
(Biodata)

Thank you...
Last edited on
Hi,

Could you show us what you did/tried, also please mention the IDE you are using
#include <iostream>
using namespace std;

void main()
{
char cCh1, cCh2;
cout <<"(Data Entry)"; cin>>cCh1;
cout <<"Entered character is:"<<cCh1 <<endl;
cout <<"(Biodata)"; cin>>cCh2;
cout <<"Entered character is:"<<cCh2 <<endl;
}
Hi,
So what's wrong with your code? Can you descibe your problem better?
This :
void main()


Should be :
int main()
ok tnx

I have tried debugging it, it only displays (Data Entry) how bout the rest of the inputted character, how am I going to make it appear like a Biodata. Do I have to include in the data entry all the needed data that needs to be entered so that it would appear in the Screen Output 2 as Biodata?

The first screen is for the data entry then the second screen output would be the biodata already.

(Data Entry)
Name:
Age:
Date of Birth:
Place of Birth
....... and so on do I have to include this in the program so that in the next screen which is

(Biodata)
Name: ___________________
Age:______________________
.......
it would appear like this...

You can use (std::string) so that std::cin can input multiple characters at a time.

And use the function std::getline() so that std::cin can even input space characters.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <string>

using namespace std;
int main()
 {
     string cCh1, cCh2;
     cout <<"Enter your name : "; 
     getline(cin, cCh1);
     cout <<"Entered string is: " << cCh1 << endl;
     cout <<"Enter your date of birth : ";
     getline(cin, cCh2);
     cout <<"Entered string is: " << cCh2 << endl;
     return 0;
 }
Does that help? :)
ok tnk u very much...it would help me a lot...God bless!!!
Glad it helped :)
Topic archived. No new replies allowed.