Answer:
int counter = 0;
String userInput = "";
while (userInput != "stop") {
print "What pet do you have? ";
userInput = readInputLine();
if (userInput != "stop" ){
counter = counter + 1;
print "\nYou have one ";
print userInput;
print ". Total # of Pets: ";
print counter;
}
}
Explanation:
not sure what programming language you use, therefore the answer is pseudocode but it should give you an idea how to implement a piece of code for this problem.
Also, from the way you described the exercise I'm not sure if you always are supposed to reply with "you have one" + the pet or if you should count how often the same pet was entered.
Answer:
To do this you'll need to use malloc to assign memory to the pointers used. You'll also need to use free to unassign that memory at the end of the program using the free. Both of these are in stdlib.h.
#include <stdlib.h>
#include <stdio.h>
#define SIZE_X 3
#define SIZE_Y 4
int main(void){
int **matrix, i, j;
// allocate the memory
matrix = (int**)malloc(SIZE_X * sizeof(int*));
for(i = 0; i < SIZE_X; i++){
matrix[i] = (int *)malloc(SIZE_Y * sizeof(int));
}
// assign the values
for(i = 0; i < SIZE_X; i++){
for(j = 0; j < SIZE_Y; j++){
matrix[i][j] = SIZE_Y * i + j + 1;
}
}
// print it out
for(i = 0; i < SIZE_X; i++){
for(j = 0; j < SIZE_X; j++){
printf("%d, %d: %d\n", i, j, matrix[i][j]);
}
}
// free the memory
for(i = 0; i < SIZE_X; i++){
free(matrix[i]);
}
free(matrix);
return 0;
}
Answer: Within other member
Explanation:
The private data member is also known as private function in the computer programming language. The private keyword is basically used to specify the access level and also provide the variable and the methods control to the programmers in the class.
In the class, the variables and the method are directly access by the other methods with the same class but not directly access by the derived class. Therefore, the private members of the class are easily access from the other member of the similar class and also from friends.
I might join I’m not sure tho is there gonna be a lot of ppl?
Answer:
A: used by ISP's to filter out email SPAM
C: a way to help an individual focus on best choices when deciding what to watch or buy.
Explanation:
Collaborative filtering uses a community-based approach to filter spam. It works by collecting numerous email users from around the world. By doing this, it becomes possible for users to flag emails that are spam and those that are legitimate.
Also Collaborative Filtering is one of the most efficient techniques for building a system that can help a user when it comes to recommending best choices based on information from a large number of users.