problem 6:c++
![]()
#include <iostream>
#include <conio.h>
using namespace std;
void main ()
{
char material;
int ocounter = 0, ccounter = 0, pcounter = 0, mcounter = 0;
cout<<"Please enter the material of your choice:\n";
cout<<"o. oak\n";
cout<<"c. cherry\n";
cout<<"p. pine\n";
cout<<"m. mahogany\n";
cout<<endl;
cin>>material;
while (material != 'z')
{
cout<<"Please enter the material of your choice: ";
cin>>material;
if (material == 'o')
++ocounter;
else
if (material == 'c')
++ccounter;
else
if (material == 'p')
++pcounter;
else
if (material == 'm')
++mcounter;
};
cout<<endl;
cout<<"Oak orders = "<<ocounter<<endl;
cout<<"Cherry orders = "<<ccounter<<endl;
cout<<"Pine orders = "<<pcounter<<endl;
cout<<"Mahogony orders = "<<mcounter<<endl;
cout<<endl;
}