|
Really thank you for your help I didn't know where to start. If you have any documentation that can help me understand better I am willing to study it thank you again.
|
|
|
|
|
You seem to be following a model that many people follow these days, which is trying to run before you can walk. If you do not understand the basics then you will always struggle. Go to Dart programming language | Dart[^] and follow some of the tutorials.
|
|
|
|
|
Good evening
Write a numberElementsPairs function that returns the number of even elements in a list of integers.
Example
var list = [1, 2, 3, 5, 7, 8]
var result = numberElementsPairs (list)
here is my solution
void main() {
nombreElementsPairs(List) {
var list = [1, 2, 3, 5, 7, 8];
var nombreElementsPairs = 0;
var a;
var resultat = 0;
for (a in (list)) {
if (a % 2 == 0) {
resultat = a % 2;
}
}
return resultat;
}
print('le nombre pair est $nombreElementsPairs(List)');
}
but it does not pass
|
|
|
|
|
olivier Dakouri wrote: ...returns the number of... I take this to mean the "count" of something.
olivier Dakouri wrote: if (a % 2 == 0) { While this is indeed checking the "even-ness" of a number...
olivier Dakouri wrote: resultat = a % 2; This is not counting anything. You should be incrementing a counter-type variable with each even number found.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
There are a number of things wrong.
1. The nombreElementsPairs function is inside the main function; it should be a separate block.
2. The list of numbers is supposed to be a parameter passed in to the function, but you ignore that and create a new local list.
3. You create the counter nombreElementsPairs but never refer to it again.
4. You test every element of the list to see if it is even, and if it is you set the resultat variable to zero. Note, that you previously initialised resultat to zero, so if all elements of the list are odd, it will still be zero at the end.
5. The return value of the function is resultat which will always be zero, which is not the count of anything.
6. The print statement does nothing useful.
As I already suggested, you should go to the Dart website and work through the tutorials, so you get to understand how to structure your program logically.
|
|
|
|
|
I was able to stop it from automatically coming up with the location of where my Wifi service is (which for some reason is about 350 miles away), and added a few cities, and selected one of the cities, but then when I got out of the app and back to the Android desktop (or whatever it's called), I get one of the other cities in the list of cities. And I don't feel like having to reboot. 
modified 18-Jul-21 20:31pm.
|
|
|
|
|
Have you seen this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
modified 13-Oct-21 8:13am.
|
|
|
|
|
There is always some difference in the position of my controls in the simulated screen and the split view (Visual Studio 2019). Which one is correct? How can I make them similar?
https://s4.uupload.ir/files/107153-1_j5q.png[^]
|
|
|
|
|
hello I want to know how to retrieve the data from an API and display this data in an array for example if I have an array that contains the users how to form an array with their name, first name, city etc ... put the values that I retrieved from an API in react native
please help me with full example
|
|
|
|
|
im aziz plss sir html cods plss sir
|
|
|
|
|
This site does not provide code to order, even if you had managed to describe the code you're demanding, or managed to use proper words instead of "text speak".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
I am trying to get GSM data into the android studio. However, this data must not come through the server. Basically, sending the data from GSM module from Arduino to android application without including any type of server such as Firebase. Need help
|
|
|
|
|
You need some form of connection between the two devices. You can then use TCP/IP sockets to communicate. Google will find plenty of samples.
|
|
|
|
|
Want to order a clone of Clubhouse from app development company. How much it would cost ?
|
|
|
|
|
Ask the company that will do the development for a quote.
We can't say "It'll be $xxx" becuase we have no idea where the dev company is, what its hour rate works out at, or how long they think it will take to produce.
And I have multiple hourly rate "charge bands" based on experience with that company and how good they are actually paying ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I do not have any programming background, but I would like to train to become a Hybrid mobile app developer from scratch. What languages and technologies do I need to learn and how can I access this training? Thank You All
|
|
|
|
|
To build a Hybrid mobile app for a Children's book with some animation, which cross platform framework should I use and what are the main differences?
|
|
|
|
|
message removed
modified 6-Jan-21 6:46am.
|
|
|
|
|
You have already posted this in QA:
Creation of android application[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for sharing. Moshe Strugano appreciate and likes the replies by the from members
|
|
|
|
|
You already posted this in the Android forum; please do not crosspost.
|
|
|
|
|
Hi everybody,
I'm new to programming and I was wondering if anyone can help me please as I am learning as I go along
Basically, I am trying to decode a telephone number in a hex dump, but I'm having trouble finding the number inside it.
I have the number and the hex dump file, but I'm really struggling to find out where it is.
Could anyone assist providing me with a few tips on searching for it.
I've been trying so many things but I keep hitting a blank.
Thanks, Dee
|
|
|
|
|
If you know the first digit in the number then search for that number's hex value. Then try the next character to see if it is the second number, and so on. The hex value for the numbers are:
0 - 30
1 - 31
2 - 32
3 - 33
4 - 34
5 - 35
6 - 36
7 - 37
8 - 38
9 - 39
|
|
|
|
|
I am also looking for help in solving this problem
modified 14-Jan-21 11:06am.
|
|
|
|