how am i going to do this with if..else, do..while?
this program should prompt the user to input college name and output the ranking of the college, and if the user input an incorrect name, the program should output a message that an incorrect name has been entered.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string college[] = {"Baylor", "Colorado", "Iowa State",
"Kansas", "Kansas State", "Missouri",
"Nebraska", "Oklahoma", "Oklahoma State",
"Texas", "Texas A&M", "Texas Tech"};
int conferenceRanking[] = {12, 11, 10, 9, 5, 8,
3, 2, 7, 1, 6, 4};
for (if)
{
cout << "Enter the name of a Big Twelve College: " << college[count]
<< college << "\n's ranking is " << conferenceRanking[count]
<< "\n" << endl;
}
return 0;
}
[sample] This is the output what i want to come up with
Enter the name of a Big Twelve College: Nebraska
Nebraska's ranking is 3
Aucun commentaire:
Enregistrer un commentaire