Which of the following is a common financial aid scam that students sometimes find on the internet?
All of the above.
Answer:
Automatic Private IP Addressing (APIPA)
Explanation:
This usually means no static IP address is assigned to the computer. Therefore it cannot connect to the Dynamic Host Configuration Protocol (DHCP). It thus uses Automatic Private IP Addressing (APIPA)(which usually ranges from 169.254.0.1 to 169.254.255.254) to configure itself.
To resolve this, disconnect the computer from the network, assign or change the Static IP and reconnect. Alternately you can reset the Modem/Router.
Answer:
#include <iostream>
#include <cstring>
using namespace std;
void replacePeriod(char* phrase) {
int i = 0;
while(*(phrase + i) != '\0')
{
if(*(phrase + i) == '.')
*(phrase + i) = '!';
i++;
}
}
int main() {
const int STRING_SIZE = 50;
char sentence[STRING_SIZE];
strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");
replacePeriod(sentence);
cout << "Updated sentence: " << endl;
cout << sentence << endl;
return 0;
}
Explanation:
- Create a function called replacePeriod that takes a pointer of type char as a parameter.
- Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
- Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
- Finally display the updated sentence.
i = 1
while i < 10001:
total = 0
x = 1
while x < i:
if i % x == 0:
total += x
x+=1
if total == i:
print(str(i)+" is a perfect number")
i += 1
When you run this code, you'll see that 6, 28, 496, and 8128 are all perfect numbers.