Hi everybody ,
I know very little about this high language,
for my studying field in BA is far & different
from the PC programming languages,which I’m studying
it to take a diploma in it. So , kindly I want your help.
I really spent two days in searching the e-books and
other forum to find a way or a rule, but I failed.
I wrote this broken code ,broken, because many of it’s
statements are not completed .Please help me, and who
wants to help me in solving them has to read these four
items carefully;
1- My program run on Microsoft Visual C++ 6.0.
2- I wrote my questions between the explanation
marks(/* */),to specify the place of my questions.
3- My program must include only
the <iostrem.h> library; why?,because this what I only
did study, in this quarter.
4- I must use the( do/while , for )as loop
statements and (switch/case), (if/else if)as conditional
and selective statements).
5- I left the condition blank as in while( ) empty .
Code:
#include <iostream.h>
void main()
{
int PartNo,Required_Qauntity ;
// here is a two dimensional array
int x[3][3]={10,50,100,20,60,200,30,70,300};
cout<<"PartNo\ tQuantityNo\tPartPrice\n";
for(int i=0;i<3;i++)
{ cout<<"\n";
for(int j=0;j<3;j++)
cout<<x[i][j]<<"\t";
}
do
{
cout<<"\nEnter the part number:\n\n ";
cin>> PartNo;
/* the program must search this PartNo in the array,.and
if it is found ,
it must go to the 3rd (do/while)statement, to ask the user
to "Enter the Required_Qauntity",
but if it isn't found the program must go to the first
statement.."enter PartNo",How??*/
do
{
for ()
{
// how can I complete this condition (if it's correct!!)
if(PartNo = =
{
//if the PartNo is exist then
cout<<"this PartNo is exist, and it's:\n"<< ( display the
entered PartNo)<<"\n";
break;}
}
/* if the PartNo not found then print the next output & go
to the first statement.." Enter the PartNo" */
cout<<" PartNo is not exisit\n";
}while ( );
do
{ cout<<"\n";
cout<<"Enter the Required_Qauntity:\n";
cin>>Required_Qauntity;
/*the program must search the array to find if this RQ is
exist or no,If yes ,thenit must display it. If No,it prints
"This Qauntity is not available" and
goes back to the the first statement .." Enter the PartNo".*/
cout<<"The Required_Qauntity is not avaliable";
}while( );
/* what is the condition here in the basic (do/while)*/
}while( );
}
thank you