Answer:
Check the explanation
Explanation:
def get_list_of_integers_from_file(filename):
int_list=[]
for line in open(filename).readlines():
try:
int_list.append(int(line))
except:
continue
return int_list
print(get_list_of_integers_from_file('file.txt'))
File.txt:
Kindly check the output below.
This video was completeley unedited was a banger, and so was the vid where they made robot amy. that was hilarious.
But since it is now Post Mortem all say here is...
Unas Annus. Memento Mori.
It sure was fun.
Answer:
The correct answer to the following question will be "Local mapping".
Explanation:
- A data independence standard in global DBMSs where questions can be constructed without understanding the local formats. Knowledge of quotas of pieces and components is however important.
- With the transparency of local mapping, the user wants to determine both fragment location and name of data items, keeping in mind any replication that may occur.
- This is clearly a more complicated and time-consuming question for all the users to answer than the first. A program that only offers it the amount of transparency would be unlikely to be satisfactory to later part-users.
Therefore, "Local mapping" is the right answer.
Answer:
The answer is "Option b"
Explanation:
In the given code three-class C1, C2, and C3 are declared, in which C2 and C3 extend the class C1. In the next line, C2 and C3 object are created, that is c2 and c3. and in the last line c2 class object holds two-class C2, C1, and one object c3 value, this code will give runtime error because it can't cast object from sibling class, and wrong choices can be defined as follows:
- In option a, It is not correct because it can't cast c3 object into c2 object.
- In option c, It is not correct because it performs multiple casting in nested forms.
- In option d, It is wrong because the statement is not correct.
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.