What is the difference between a MAC address and an IP address. Relate your answer to the OSI model
The following program has a bug when the user enters more than one name on the first
prompt. Execute the program by entering more than one string on the first prompt, observe
and state what is the bug on the program as a block comment, then modify the program to
fix the bug.
1 #include <iostream>
2 using namespace std;
3
4
5 int main(){
6
7 string name, surname;
8
9 cout<<"Please enter your name: ";
10 cin>>name;
11 cout<<"Please enter surname: ";
12 cin>>surname;
13 cout<<"Hi, "<<name<<" "<<surname<<endl;
14
15 return 0;
16 }
Write a program that prompts the user for an integer and then prints out all coward numbers up to
that integer. For example, when the user enters 20, the program should print: 3 4 6 8 12 14 18 20.
Recall that a number is a prime number if it is not divisible by any number except 1 and itself.
Hint: Use Nested Loop to solve this problem. Outer Loop iterations must start from 3 and ideally inner
loop iterations must start from 2.
Coward Number: Number whose previous number is not divisible by any number other than 1
and number itself.
Instructions:
1. Create a program called CowardNumbers.java.
2. Create appropriate variables and assign values using a Scanner object.
Not getting proper output
Tic-Tac-Toe game
Abhinav and Anjali are playing the Tic-Tac-Toe game. Tic-Tac-Toe is a game played on a grid that's three squares by three squares. Abhinav is O, and Anjali is X. Players take turns putting their marks in empty squares. The first player to get 3 of her marks in a diagonal or horizontal, or vertical row is the winner. When all nine squares are complete, the game is over. If no player has three marks in a row, the game ends in a tie. Write a program to decide the winner in the Tic Tac-Toe game.
Not getting output please send corrected output
Add two polynomials
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
Input
The first line contains a single integer M. Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A. After that next line contains a single integer N. Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
Not getting output please give a corrected code
Secret Message -1
Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.
Note: Mirroring the characters in alphabetical order replacing the letters 'a' with 'z', 'b' with 'y', ..., 'z' with 'a'. You need to mirror both uppercase and lowercase characters. You can ignore mirroring for all characters that are not letters.