dimanche 7 novembre 2021

Program To Display Tea Brands Which Have Sold Over 500 Tea Bags C++

Cannot Seem To Get The Output, Dont Know Why I Have tried using Arrays and For loops and cant seem to understand why I am not getting the output

#include <iostream>
#include <string>
using namespace std;

int main (){
int count;
int final;
cout<<"Enter The Amount Of Tea Brands"<<endl;
cin>>count;

string Brand [count];
int Amount [count];
string Output [100];

for(int i =0;i<count;i++) {
    cout<<"Enter Brand Name"<<endl;
    cin>>Brand[i];
    for(int j =0; j<count; j++){
        cout<<"Enter Sold"<<endl;
        cin>>Amount[j];
        break;
    }       
}

for(int k=0; k<count; k++){
    if (Amount[k]>500){
        Brand[k]=Output[k];
    }
}

for (int l=0; l<count; l++){
    cout<<Output[l];
}

}

Aucun commentaire:

Enregistrer un commentaire