Answer:
B - A word is correctly spelled but is used incorrectly in a document
Answer:
The list created by the split method in Python 3 will be ["red", "orange", ""yellow", "green", "blue"]
Explanation:
In Python 3, the split method takes the input string, in this case is colors = "red,orange,yellow,green,blue", and split it into a list and you can indicate the separator that the method will use.
The general syntax for this method is:
string.split(separator,max)
separator indicates the character that will be used as a delimiter of each list member and the max parameter indicates the maximum number of separations to make.
Since each color in your string is separated by the character "," the code will make a list in which every color is a separated string.
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.
Answer:
Problem-solving. Why is problem-solving so valued? Companies face a lot of obstacles. Those better able to cope
Explanation: