Question

In: Computer Science

The below mentioned figure shows a General diagnosis flowchart for troubleshooting HP servers. Use the flowchart...

The below mentioned figure shows a General diagnosis flowchart for troubleshooting HP servers. Use
the flowchart to create a C++ program that leads a person through the steps of fixing a bad HP server.
Here is an example of the program’s output (following one of the flow):
Starting General Diagnosis Program.
Recoding symptoms information - DONE.
Rebooting server to see if condition still exists - DONE.
Is this a newly installed server? yes [enter]
Please reseat any components that may have come loose during shipping - DONE.
Rebooting the server - DONE.
Does the condition still exist? no [enter]
Recording all actions taken for future - DONE.
Congratulations, your server problems are solved.
Notice the program ends as soon as a solution is found to the problem.

Solutions

Expert Solution

CODE:

#include<iostream>
#include<iomanip>
#include<cstring>
#include<bits/stdc++.h>
using namespace std;

int main() {
   cout<<"Starting General Diagnosis Program";
       string ans;
   cout<<"\nRecording symptoms information - DONE"; // (1)
   cout<<"\nRebooting server to see if condition still exists - DONE";
   cout<<"\nIs this a newly installed server?";
   cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
   if(strcmp(ans.c_str(),"yes")==0) { //(2)
       cout<<"\nPlease reseat any components that may have come loose during shipping - DONE";
       cout<<"\nRebooting the server. - DONE";
       cout<<"\nDoes condition still exist? ";
       cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
       if (strcmp(ans.c_str(),"yes")==0) {
           goto checkConfigChange;
       }
       else {
           goto recordAllActions;
       }
   }
   else {
   checkConfigChange:
       cout<<"\nWere options added or was the configuration changed recently: ";
       cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
       if (strcmp(ans.c_str(),"yes")==0) {
          
           cout<<"\nIsolating what has changed - DONE \n Verifying it was installed correctly - DONE.\n Restoring server to last known working state or original shipped configuration - DONE";
          
           cout<<"\nDoes condition still exist? ";
           cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
           if (strcmp(ans.c_str(),"yes")==0) {
          
               IsolateMinMemConfig: //(5)
               cout<<"\nIsolating and minimizing the memory configuration - DONE";
              
               cout<<"\nDoes condition still exist? ";
               cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
               if (strcmp(ans.c_str(),"yes")==0) {
                   cout<<"\nBreaking server down to minimal configuration. - DONE";
                   cout<<"\nDoes condition still exist? ";
                   cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
                   if (strcmp(ans.c_str(),"yes")==0) { //(7)
                       cout<<"\nTroubleshoot or replace basic server spare parts - DONE";
                      
                       cout<<"\nDoes condition still exist? ";
                       cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
                       if (strcmp(ans.c_str(),"yes")==0) {
                           //( 8 )
                           CollectSystemInfo:
                           cout<<"\n Ensuring whether following information is available: \n 1. Survey configuration snapshots \n \
                           2. OS event log file \n \
                           3. Full crash dump. - DONE";
                          
                       }
                       else {
                           cout<<"\n Recording symptom and error information on repair tag if sending back a failed part - DONE";
                           goto end;
                       }
                  
                   }
                   else { //(6)
                       cout<<"Adding all parts, one part at a time back to configuration to isolate faulty component . -DONE";
                       cout<<"\nDoes condition still exist? ";
                       cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
                       if (strcmp(ans.c_str(),"yes")==0) {
                           goto CollectSystemInfo;
                       }
                       else { goto recordAllActions;}
                   }
                  
               }
               else { goto recordAllActions;}
          
           }
           else { goto recordAllActions;}
       }
       else {
           cout<<"\nChecking for Service Notification - DONE"; //(3)
           cout<<"\nDownloading the latest software and firmware from the HP website - DONE"; //(4)
          
           cout<<"\nDoes condition still exist? ";
           cin>>ans; transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
           if (strcmp(ans.c_str(),"yes")==0) {
               goto IsolateMinMemConfig;
           }
           else { goto recordAllActions;}
          
       }
   }

   recordAllActions:
   cout<<"\nRecording all actions taken for future - DONE.";
  
   end:
   cout<<"\nCongratulations, your server problems are solved";
   return 0;
  
   callHP:
   cout<<"\nPlease Call HP Service Provider."; //(9)
   return 0;
}

Snapshot:

case 1:

Case 2:


Related Solutions

In this Java lab, you use the flowchart and pseudocode found in the figure below to...
In this Java lab, you use the flowchart and pseudocode found in the figure below to add code to a partially created Java program. When completed, college admissions officers should be able to use the Java program to determine whether to accept or reject a student, based on his or her test score and class rank. Declare the variables testScoreString and classRankString. Write the interactive input statements to retrieve: A student’s test score (testScoreString) A student's class rank (classRankString) Write...
The figure below shows a market in equilibrium.
Problem 6-3 The figure below shows a market in equilibrium. a. Draw a price ceiling at $12. Instructions: Use the tool provided (Ceiling-) to draw the price ceiling. The amount of shortage at this price is _______ The deadweight loss is _______ b. Draw a price ceiling at $4 Instructions: Use the tool provided (Ceiling2) to draw the price ceiling. The amount of shortage at this price is _______ Draw the deadweight loss associated with this price ceiling. Instructions: Use the tool provided (DWL) to draw the deadweight loss for...
Required: Based on the summary narrative below, prepare a document flowchart that shows the flow of...
Required: Based on the summary narrative below, prepare a document flowchart that shows the flow of information and the procedures performed as part of the acquisition/payment system at Oriental Trading. Use flowcharting symbols. Background information Since opening its doors in Hawaii two years ago, Oriental Trading has enjoyed tremendous success. As a wholesaler, Oriental Trading purchases textiles from Asian markets and resells them to local retail shops. To keep up with the strong demand for textiles in the Hawaiian Islands,...
The figure below shows a cross section across a diameter of a long cylindrical conductor
The figure below shows a cross section across a diameter of a long cylindrical conductor of radius a = 2.00 cm carrying uniform current 159 A. What is the magnitude of the current's magnetic field at the following radial distances?(a) 0_____ T(b) 1.20 cm_____ T(c) 2.00 cm (wire's surface)______ T(d) 3.90 cm______ T  
The figure below shows four small spheres, each with a positive charge, at the corners of...
The figure below shows four small spheres, each with a positive charge, at the corners of a square. The length of each side of the square is a. The sphere at top-right has a charge of q; the one at lower-left has a charge of 2.0q; the other two each have a charge of 5.0q. (Assume that the +x-axis is to the right and the +y-axis is up along the page.) 2.0q5.0q5.0q Four positive charges are organized in a square...
The figure below shows an RC circuit. The capacitor is initially uncharged. At t = 0,...
The figure below shows an RC circuit. The capacitor is initially uncharged. At t = 0, the switch is closed to point a. Find the time it takes for the capacitor voltage to reach one third the battery voltage. Use the figure above. In the figure, the switch has been at point a for a long time and the capacitor voltage is equal to the battery voltage. At t = 0, the switch is moved to point b. Find the...
The figure below shows a stream of water in steady flow from a kitchen faucet. At...
The figure below shows a stream of water in steady flow from a kitchen faucet. At the faucet, the diameter of the stream is 0.960 cm. The stream fills a 125-cm3 container in 16.0 s. Find the diameter of the stream 13.0 cm below the opening of the faucet.
Use a Normal distribution table such as the one located at the link mentioned below to...
Use a Normal distribution table such as the one located at the link mentioned below to work on Problems 1, 2 and 3 with N(μ,σ2). Note: the sigma squared. The notation is not universally used the same. Show the work for your calculations. http://users.stat.ufl.edu/~athienit/Tables/Ztable.pdf 1-1) Calculate P(X<0.4) if X ~ N(0,1) 1-2) Calculate P(X<0.4) if X ~ N(1,4) 1-3) Calculate P(X>0.4) if X ~ N(1,¼)
For each case listed below, give a specific diagnosis, then state the general class of disorders...
For each case listed below, give a specific diagnosis, then state the general class of disorders to which that disorder belongs (anxiety disorders, mood disorders, personality disorders, dissociative disorders, drug abuse and addiction, or schizophrenia). 1. Tony sometimes seems very “wound up.” At those times, he seems full of energy, talks very rapidly, and makes very grandiose plans. (One time, he gave away all of his belongings and was planning to move to Washington, D.C., so he could advise the...
the figure shows the graph of f(x) = ex. in the exercise 1 to 4, use...
the figure shows the graph of f(x) = ex. in the exercise 1 to 4, use transformation of this graph to graph each function. be sure to give equation of this the asymptotes. use the graph to determine each function's domain and range. if applicable, use a graphing utility to confirm your graph 1). g(x) = ex-1 2). g(x) = ex+2 3) h(x) = e-x 4) g(x) = 2ex
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT