1: Application
2: Presentation
3:Session
4: Transport
5:Network
6: Data link
7: Physical
Application is a Interface Layer and responsible Layer
<span />
Answer:
#include <iostream>
using namespace std;
int main()
{
string str;
cout<<"Enter the string: ";
cin>>str;
for(int i=0;str[i]!='\0';i++){
if(str[i]=='e'){
str[i]='x';
}
}
cout<<"the string is: "<<str<<endl;
return 0;
}
Explanation:
First, include the library iostream for using the input/output instructions.
Create the main function and declare the variables.
Then, use the cout instruction and print the message on the screen.
cin store the string enter by the user into a variable.
After that, take a for loop and if-else statement for checking the condition if the string contains the 'e', then change that alphabet to 'x'.
This process continues until the string not empty.
Finally, print the updated string.
Answer:
The objects created in the main method and their initial states are given below
Explanation:
The objects and initial state of each object( the values of each object’s variables) are thus:
We have objects awesome, amazing and fantastic.
initial state of awesome object is
aName = "Awesome"; aNumber = 5; amAwesome = true;
initial state of amazing object is
aName = "Amazing"; aNumber = -10; amAwesome = false;
initial state of fantastic object is
aName = "Fantastic"; aNumber = 11; amAwesome = true
From what my teacher taught us it would be c.