Write a program using string function that will accept the course abbreviation as input value and it will display the corresponding college.
COURSE COLLEGE
BSBIO CAS
BSA CBS
BSBA
BSAT
BSENTREP
BSINFOTECH CCS
BSIS
BSCS
BSAR CEA
BSCE
BSECE
BSEE
BSIE
BSME
BSHRM CHM
BSTM
EOC CIT
BSIT
BEED COE
BSEED
BPE
BSSOC CSSP
BSSW
//There is add a few ABBR you cann add to array
#include <iostream>
#include <string.h>
#include <iomanip>
using namespace std;
int main()
{
//USE GOOGLE will find pair value and push in to programm
char colg[][50]={"Australian College of Applied Psychology",
"Adhiyamaan College of Engineering","Aravali College of Engineering and Management","Assam Engineering College",
"Ashton Sixth Form College","Bengal College of Engineering & Technology","Basingstoke College of Technology","Community Business College","Coffeyville Community College","College of Continuing Education","European Security and Defence College","General College","Griffith College Dublin"}; //sitehttps://www.allacronyms.com/course/abbreviations/colleges/2
//for add or change ABR and college
char abr[][50]={"ACAP","ACE","ACEM","AEC","ASFC"
,"BCET","BCOT","CBC","CCC","CCE","CET","ESDC","GC","GCD","\0"};
char str[50];
cout<<"Please input abbreviation for searching: ";
cin>>str;
//if user input small register change to UPPER
for(unsigned i=0;i<strlen(str);i++)
str[i]=toupper(str[i]);
//compair with base abbr
bool is=false;
for(unsigned i=0;i<14;i++)
{
if(strcmp(str,abr[i])==0)
{
cout<<"Found: "<<colg[i]<<endl;
is=true;
break;
}
}
if(!is)
{
cout<<"Sorry we can't found this abbraviation Please search to GOOGLE\n";
}
return 0;
}
Comments
Leave a comment