[Solved] Explanation needed for v

The 2.2 is the number of times that x will be repeated (not what x will be multiplied by). In your example x has length 5 and y has length 11. The 2.2 comes because 2.2 times 5 is 11, so in order to have 2 vectors of the same length to add together, the … Read more

[Solved] Java program which sums numbers from 1 to 100

nmb++ is equal to nmb = nmb + 1. It only adds one till it’s 101, which is when it stops. You should add a new variable, let’s call it total, and sum nmb to it every iteration. public class T35{ public static void main(String[] args) { int nmb; int total = 0; for(nmb= 1; … Read more

[Solved] How can css for id same format [closed]

Just to point out that you can do this with just id’s by utilizing attribute selectors. But as others have said, you should really use classes instead body { background: #333 } /* ID starts with xyz */ [id^=xyz] { color: white } /* ID ends with _t */ [id$=_t] { color: red } /* … Read more

[Solved] Language C: convert a number grade into a letter grade

Just use a string a look up the appropriate entry: char convert(int numberGrade ){ if (numberGrade >=0 && numberGrade <= 20) { // 012345678901234567890 return “FFFFFFEEDDCCCBBBAAAAA”[numberGrade]; } return ‘X’ } EDIT Also you need to move the call to the convert function After you enter in the value. See below: int main(){ int note; printf(“Quelle … Read more

[Solved] Emails in C2DM?

It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent. You must have that role email the same as the one on the server otherwise Google will not be able to identify your … Read more

[Solved] Can anyone explain the following JavaScript code for unique value how is it internally compared with each other [closed]

return arr.indexOf(value) === arr.lastIndexOf(value); You have an array. Every element in the array has an index. .indexOf() will give you that index. So if an element is unique, the first index it appears at is the same as the last index. If the element would not be unique, the lastIndex will be higher than the … Read more

[Solved] how to print an array backwards

You’re very close. Hope this helps. #include <iostream> using namespace std; int main(int argc, char *argv[]) { int numbers[5]; /* Get size of array */ int size = sizeof(numbers)/sizeof(int); int val; for(int i = 0; i < size; i++) { cout << “Enter a number: “; cin >> val; numbers[i] = val; } /* Start … Read more

[Solved] Structs in C Error [closed]

You have several problems: Format specifiers start with a % sign. So change scanf(“d”, &element[j].age); to scanf(“%d”, &element[j].age); and scanf(“s”, &element[j].name); to scanf(“%s”, element[j].name); Wondering why I removed the & from the above scanf? It is because array names gets converted to a pointer to its first element. These printf(“%d. Fav number: %d\n”, k, &element[k].age); … Read more

[Solved] DateTime.ParseExact() – DateTime pattern ‘y’ appears more than once with different values

Your format should be yyyy-MM-dd HH:mm:ss.fff string testDateRaw = @”2014-05-21 10:08:15.965″; string format = “yyyy-MM-dd HH:mm:ss.fff”; DateTime testDate = DateTime.ParseExact(testDateRaw, format, CultureInfo.InvariantCulture); System.Console.WriteLine(testDate); See: Custom Date and Time Format Strings solved DateTime.ParseExact() – DateTime pattern ‘y’ appears more than once with different values

[Solved] Manipulating std::string

memset(data,0,1500); // This might not be correct but it works fine It isn’t correct, and it doesn’t “work fine”. This is Undefined Behaviour, and you’re making the common mistake of assuming that if it compiles, and your computer doesn’t instantly catch fire, everything is fine. It really isn’t. I’ve done something which I wasn’t supposed … Read more