How to Create Effective Service Catalog Prototype?

Service Catalog

1      Scenario

You are an IT Specialist working for large company called Widgets Galore of over 1000 employees and Widgets Galore is made up of the following divisions:

  1. Communications and Marketing
  2. Sales
  3. Distribution and Warehousing
  4. Contracting and Legal
  5. Information Technology

The company is sorely in need of a light weight Information Technology Service Catalog.  A Service Catalog A service catalog is an organized and managed collection of any and all business and information technology related services that can be performed by, for, or within an enterprise.

The company Chief Executive Officer, wants IT to create a working prototype of a Service Catalog that can be used to demonstrate the usefulness of a Service Catalog and once tested, the CEO then would like the data collected to be stored in such a format that it can be imported into a fully functional, enterprise level service catalog application.

Your Chief Information Officer (CIO) has tasked you with creating Service Catalog prototype.

2      Requirements

A service catalog is an organized and curated collection of any and all business and information technology related services that can be performed by, for, or within an enterprise.  The service catalog documents the details of each mission critical service the IT office provides the company’s divisions.  The prototype will collect and store for each service catalog item:

  1. name of the service
  2. description of the service
  3. which divisions of the company use the service
  4. cost of hardware that supports the service
  5. cost of software that supports the service

The following are individual processing requirements:

  1. There shall be a message that provides directions to the user.
  2. The program shall be a menu driven program, where the user can choose which of the operations they want to execute.
  3. After each operation is executed, the menu will continue to be displayed until the user selects exit.
  4. If the user chooses to enter service items, the user shall be able to enter items until they decide to stop entering items, then the main menu will be re-displayed.
  5. Each service item shall have a unique identifier that can be used to search for the item.
  6. The item name shall not be empty and no more than 50 characters.
  7. The description shall not be empty and no more than 255 characters.
  8. The division cannot be empty and the value can only be one of the identified company divisions.
  9. The required hardware cost can be 0 but no more than 100000 dollars.
  10. The required hardware cost can be 0 but no more than 250000 dollars.
  11. Given a service items ID, the data store shall be searched and all service item information shall be displayed on the screen. If an item cannot be found, an error message will be displayed.
  12. Given a service items name, no matter the case, the data store shall be searched and all service item information shall be displayed on the screen. If an item cannot be found, an error message will be displayed.
  13. Full report of all service items including the item name, description, and total cost of hardware and software, and date of the report. The report will be displayed on the screen and also written to a text file that can be opened and printed from any external text editor or word processor.
  14. Once saved, the report shall be able to be opened and displayed on the screen.

 

 

3      Design and Coding Requirements

The following are design and coding requirements that you need to satisfy:

  1. Requirements and design documentation shall adhere to the Analysis and Design standards used throughout the class.
  2. The program shall be a modular design using a 3-tier architecture that separate the presentation, business logic, and data operations into separate modules.
  3. The main program shall not contain any data processing and only control execution of the program.
  4. There shall not be any literal numbers in the program.
  5. Each major operation will be implemented in a separate file.
  6. There will not be any global variables and all data communication shall be done module arguments and parameters.
  7. Program source code shall follow the coding standards document.

Solution:

#include “default.h”

 

int main()
{

    int menuChoice;

do {
    
    cout << “\n———————Menu——————-\n\n”;
    cout << “1. Enter Service Catalog Item.\n”
            “2. search for the item.\n”        
            “3. Exit Program.\n\n”;
     cout << “Choice : “;
    cin >> menuChoice;
  cin.get();

    switch (menuChoice)
    {
    case 1:   
                 ServiceItemCatalog();
            
              break;
    case 2:
                 serchItem();  
              
              break;
 
    case 3: cout << “Good Bye! :)\n”;
              break;
    default:  cout << “Invalid Input.”;
    }
    }while (menuChoice!=3);

            return 0;
}
void writedataReport(int lineNumber){
     fstream file(“serviceItems.txt”);
 
    
 std::string s;
int limt = lineNumber+6;
for (int i = lineNumber; i <=limt ; i++)
            std::getline(file, s);
             s = s+”\t”;
   
    
 
    cout << “\n—————-Report————————\n\n”;
    
      
         cout << “ID \t Service Item\t Description \t Division \t cost of hardware\t Cost of software\n”;
           cout << s;
         
 

}
int count = 0;
void serchItem(){
     int count = 0 ;
     std::string s;
    string id  ;
    cout << “\nEnter ID of the service Item :  “;
            cin>>id;
            cin.get();    
            int yes = 0 , stop=0;
    std::ifstream file(“serviceItems.txt”);
    std::string str;
    while (std::getline(file, str))
    {
       if (str.find(“##:”) != string::npos) {
       string ids =   str.substr(str.find(“:”) + 1);
         int sid1 =  atoi(id.c_str());
         int sid2 =  atoi(ids.c_str());
         if(sid1 == sid2){
         yes = 1;
    //     writedataReport(count);
         }
        
         }
          if(yes == 1 && stop < 6){
             stop++;
             s += str+”\t”;
        
        
         }
             count++;
            }
               cout << “\n—————-Report————————\n\n”;
    
      
          cout << “ID\tItem  Desc   Division  hard software\n”;
           cout << s;
         
      
      
    }

 void ServiceItemCatalog(){
     
    char Item[20] ;
    char description[35] ;
    char divisions[25] ;
    char costh[10], costsoft[10];
     cout << “\nEnter name of the service Item? “;
            cin.getline(Item,sizeof(Item));
              //   cin>>Item;
                //  cin.get();
               cout << “\nEnter description of the service? “;
              cin.getline(description,sizeof(description));
              // cin.get();
               cout << “\nwhich divisions of the company use the service? “;
               cin.getline(divisions,sizeof(divisions));
              //  cin.get();
              cout <<“\ncost of hardware that supports the service? “;
              cin >> costh;
              cin.get();
              cout <<“\ncost of software  that supports the service? “;
              cin >> costsoft;
              cin.get();
              
              ifstream infile(“id.txt”); fstream myfile;
int id;
  if (infile.good())
  {
    string sLine;
    getline(infile, sLine);
   
      id = atoi(sLine.c_str());
      id++;
      cout << id << endl;
      myfile.open (“id.txt”);

  }
 
std::string sid = SSTR(id);
myfile << sid;
myfile.close();
sid = “##: “+sid;
  infile.close();
     
           std::ofstream outfile;

       outfile.open(“serviceItems.txt”, std::ios_base::app);
         outfile << “\n\n”+ sid + “\n” + Item + “\n” +description + “\n” +  divisions + “\n” + costh + “\n” + costsoft ;
 }

Output Screen:

Service Catalog prototype

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here