

Is It There or Not?
source link: http://programmingbydoing.com/a/is-it-there-or-not.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

- Author: Graham Mitchell
- Filename: IsItThereOrNot.java
Is It There or Not?
Create an array that can hold ten integers, and fill each slot with a different random value from 1-50. Display those values on the screen, and then prompt the user for an integer. Search through the array, and if the item is present, say so. If the value is not in the array, display a single message saying so. Just like the previous assignment, if the value is present more than once, you may display the message as many times as necessary.
Array: 45 39 32 12 44 50 26 42 16 20 Value to find: 42 42 is in the array.
Array: 45 39 32 12 44 50 26 42 16 20 Value to find: 43 43 is not in the array.
©2013 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Recommend
-
5
Video, Not There yetotsukare Thoughts after a day of workVideo, Not There yet Mar 31 janvier 2012by
-
2
coroutines Do or do not; there is no tryEmit() Dan Lew...
-
5
There or Not?Author: Graham Mitchell Filename: ArraylistThereOrNot.java ArrayList - There or Not? Create an ArrayList of Integers, and fill each slot with a different random value from 1-50....
-
2
There are not enough BTUsY'all ready for it?Let me hear you say “Rebirth!”Y’all not ready for it.Y’all ready for it?Rebirth Brass Band, The Main Event
-
5
When there’s not enough room for sprintf… 2 Replies ...
-
5
Let’s Go to Mars. Let’s Not Live ThereSpace agencies and companies aim to send people to the Red Planet. But settling there would be hell on—well, you know what we mean.
-
9
@andrewredicanAndrew RedicanSoftware engineer. Passionate about creating things.Credibility...
-
8
Gen Z is a serious threat to Android – there may not be an Android OS in ten years
-
10
No, it is not a security vulnerability that there is no certificate of appreciation for reporting a bug
-
1
Systems & Design Not All There: Heterogeneous Multiprocessor Design Tools...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK