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'.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. C++

    #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?
  2. C++ Programming

    Can any1 please fix this c++ source problem /*Circle Are program Calculates the area of a circle using the formula A=pi * r * r Sonny Hinh, 1/23/08 #include <iostream.h> int main() { cout << "-Calculate the area of a circle-" …
  3. C++ Programming

    I NEED HELP WITH MY CODE!!! it won't compile right The formula for finding the force of gravity between two objects is Force = grav * (mass1 * mass2) / (radius * radius), where Force = the force of gravity between the two objects, …
  4. C++ Programming

    #include <iostream.h> #include <stdlib.h> #include <math.h> int main ( ) { double noe, nod, dc1, dc2, dc3, dc4, t; cout << "Enter number of eggs: "; cin >> noe; nod = noe / 12; dc1 = .50 / 12; dc2 = .45 …
  5. C++ Programming

    #include <iostream.h> #include <stdlib.h> #include <math.h> int main ( ) { double noe, nod, dc1, dc2, dc3, dc4, t; cout << "Enter number of eggs: "; cin >> noe; nod = noe / 12; dc1 = .50 / 12; dc2 = .45 …
  6. C++ Programming

    I have to redo programming exercise 5 of chapter 9 using dynamic arrays. but I have the information but I don't know how to use it in a dynamic arrays please help. //Chapter 9: Programming Exercise 5 #include <iostream> #include …
  7. C++ if else problem, please look

    It compiles but it doesn't work. can you tell me what i did wrong?
  8. programming C++

    Write a program that reads test scores up to 30 into an array. sentinel will stop when -1 is entered. Write functions that: 1. read the scores into arrays 2. computes the distribution based on whether they are As, Bs and so on 3. find …
  9. C++

    Would you check and correct my error please! ******************************* #include<iostream.h> #include<string.h> #include<bitset> viod Binary_to_Decimal(); int main(int argv,char argc) { while(1<2) { int m_choise; …
  10. C++

    I am trying to create a program that displays shipping charges for two region codes. The region code has to have exactly 3 characters (the letter A or B followed by two numbers). Display a message if invalid region code is entered. …

More Similar Questions