Answer:
where glasses gloves turn on the power tool
Explanation:
Answer:
#include <iostream>
using namespace std;
int main()
{
char str[100][20];
int n;
cout<<"Strings you want to enter"<<endl;
cin>>n;
cout<<"enter n strings"<<endl;
for(int i=0;i<n;i++)
cin>>str[i];
for(int i=0;i<n;i++)
{
if((int)str[i][0]==98) //ascii value b is 98
cout<<str[i]<<endl;
}
return 0;
}
Explanation:
The above written code is for printing the strings which starts with the letter b.
To check if the string starts with a letter b we are checking the ascii value 98 which corresponds to b and then printing those strings.
Answer:
A)
This is an example of tight coupling since the class Working has to have an idea of how Person is implemented to complete its own implementation.
B)
Any change in the Person class would require a change in the working class too.
C)
CODE
class Person {
int personID, age;
String fName, middleName, lastName;
public int getAge() {
return age;
}
}
// end of Person class
class Working extends Person {
boolean isUnderEighteen() {
if (super.getAge() <18) {
System.out.println("The person is under age and cannot work");
return true;
}
else {
System.out.println("The person can legitimately work");
return false;
}
}
}
Explanation: