Answer:
predictable
Explanation:
because it repeat itself all time
A program that initializes a vector with the following string values: “what” “book” “is” “that” “you” “are” “reading” are the usage of namespace std;int main().
<h3>What is a vector software program?</h3>
Vector images software program permits customers to layout and manages pc photos the usage of geometric and mathematical commands, instead of clicks and strokes as utilized in drawing software program. Vector photos created the usage of those applications may be scaled indefinitely with out dropping quality.
- #include
- #include
- #include
- the usage of namespace std;
- int main()
- ;
- vector::iterator it;
- for (it = vs.begin(); it != vs.end(); it++)
- string tmp;
- while (cin.get()!='n')
- for (it = vs.begin(); it != vs.end(); it++)
- }
Read more about the vector :
brainly.com/question/25705666
#SPJ1
Answer:
#include <iostream>
#include <vector>
using namespace std;
void calGPA();
vector<int> g;
vector<int> h;
int main(){
char pushMore = 'y';
int fg, fh;
for (;;){
if (pushMore == 'n'){
break;
} else{
cout<< "Enter integer for grade: ";
cin>> fg;
cout<< "Enter integer for credit hours: ";
cin>> fh;
g.push_back(fg);
h.push_back(fh);
cout<< "Do you want to add more grade and credit hours? y/n: ";
cin>> pushMore;
}
}
calGPA();
}
void calGPA(){
double total = 0, GPA;
for (int i = 0; i < g.size(); ++i) {
total += g.at(i) * h.at(i) ;
}
cout<< "The GPA is : "<< total/g.size();
}
Explanation:
The C++ source code above defines two vectors 'g' and 'h'. The latter holds the grades of a student while the former holds the credit hours for the subject taken. The void 'calGPA' function calculates and prints the student's GPA.