Post a New Question

C++

posted by .

#include <iostream.h>
#include <stdlib.h>
int main ( )
{
int choice;
cout << "Computer Repair" << endl;
cout << "\n Does your ailing computer beeps multiable times at startup?" << endl;
cin >> choice;
switch (choice)
{
case Yes: cout << "\n Does the hard drive spin?" << endl; break;
cin >> choice;
switch (choice)
case Yes: cout << "\n Contact tech support. << endl; break;
case No: cout << "\n Check drive contacts. << endl; break;
}
case No: cout << "\n Does the hard drive spin?" << endl; break;
cin >> choice;
switch (choice)
case Yes: cout << "\n Check speaker contacts << endl; break;
case No: cout << "\n Bring computer to repair center. << endl; break;
}
system("Pause");
return (0);
}


make it work plz

  • C++ -

    First problem I see is in your first case 'Yes'. You output "Does the hard drive spin?", then you have a "break;". The break takes you out of the first enclosing switch. So, the cin does not get executed. This same error is in the first case 'No'.

Answer This Question

First Name
School Subject
Your Answer

Related Questions

More Related Questions

Post a New Question