Home Forums C Programming Need help URGENTLY on my assignment (instructions inside) Re: Re: Need help URGENTLY on my assignment (instructions inside)

#3523
GWILouisaxwzkla
Participant

Not totally sure what you need ( not sure what the ‘p’ condition should be ) but heres a start:



/****************************************************************
* File Name : c:programstempCG.cpp
* Date : March,16,2009
* Comments : new project
* Compiler/Assembler :
* Modifications :
*
*
*
*
*
* Program Shell Generated At: 3:34:03 p.m.
=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/


#include
//#include
//#include
//#include
//#include
//#include

using namespace std;

//main function ******************************

int main ( )
{

char hello [ 12 ] = "Hello world";
char ch;
char newline = 10;

cout < ";
ch = cin.get();
while ( ch != newline )
{


if ( ch > 0 && ch < 0 )
cout << "x" << endl;
else if ( ch - '0' >= 0 && ch - '0' <= 11 )
cout << hello [ ch - '0' ] << endl;
else if ( ch - '0' 11 )
cout << "z" << endl;
ch = cin.get();
}
return 0 ;
}