Answer:
class TestPerson : public Person {
private:
string test_name;
int test_age;
char test_gender;
float test_height;
public:
TestPerson (string name, int age, char gender, float height) : Person(name, age, gender, height) {
this -> test_name = name;
this -> test_age = age;
this -> test_gender = gender;
this -> test_height = height;
}
void testSetName() {
test_name = "qwerty";
setName(test_name);
if (name.compare(test_name) == 0)
cout << "Test passed";
else
cout << "Test failed";
}
void testSetAge() {
test_age = 999;
setAge(test_age);
if (age == test_age)
cout << "Test passed";
else
cout << "Test failed";
}
void testSetGender() {
test_gender = 'X';
setGender(test_gender);
if (gender == test_gender)
cout << "Test passed";
else
cout << "Test failed";
}
void testSetHeight() {
test_height = 100.563f;
setHeight(test_height);
if (height == test_height)
cout << "Test passed";
else
cout << "Test failed";
}
void testGetName() {
if (getName().compare(test_name) == 0)
cout << "Test passed";
else
cout << "Test failed";
}
void testGetAge() {
if (getAge() == test_age)
cout << "Test passed";
else
cout << "Test failed";
}
void testGetGender() {
if (getGender() == test_gender)
cout << "Test passed";
else
cout << "Test failed";
}
void testGetHeight() {
if (getHeight() == test_height)
cout << "Test passed";
else
cout << "Test failed";
}
}
Answer:
1. #include <stdio.h>
2. int main()
3. {
4. int k;
5. int j;
6. int i;
7. int array[7];
8. array[0] = 1;
9. for (i = 1; i < 9; ++i)
10. {
11. array[i] = array[i-1]*2;
12. for (j=0; j < i; ++j)
13. {
14. printf("%d ",array[j]);
15. }
16. for (k=i-2; k > -1; --k)
17. {
18. printf("%d ", array[k]);
19. }
20. printf("\n");
21. }
22. return 0;
23. }
Explanation:
- From line 1 to 3 we start the main function
- From line 4 to 7 we declare the variables that we are going to be using throughout the program including an array of 7 positions
- On line 8 we initialize the array with one to match the sequence
- From line 9 to 10 we create a for loop to create the 9 sequences of numbers
- On line 11 we assign values to the array by taking the previous value and multiplying it by 2, this way we can create the sequence 1,2,4,8,32...
- From line 12 to 15 we print the ordered array
- From line 16 to 19 we print the inverse array minus one
- On line 20 we print an enter
Answer:
Models represent the system or problem at a detailed implementation level.
Models help communicate a design.
Models help you understand a complex situation by including all of the details.
hope this is correct :)
Answer:
True
Explanation:
In a web page, there are two categories of content, they are, the main content and the supplementary content.
The main content holds the needed information of the web page and changes from page to page, while the supplementary content, as the name implies, supports the quality of the main content. It content can be duplicated in multiple pages and does not need a high rating to promote the quality of a web page.
Answer:
Delete unnecessary apps
Explanation:
If you don't need it and its installed it's just using up memory the system could be using for something else