Given a box of balls having 20 balls and each ball is numbered in the range 1-100 randomly. Write a program in which buyer enters the ball number required by him and program searches for the asked ball number and print "Available" if that ball is present or "Not available" if it is not present. Note: Balls are numbered randomly so use rand() function to generate ball number

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Search game: 

Given a box of balls having 20 balls and each ball is numbered in the range 1-100 randomly. Write a program in which buyer enters the ball number required by him and program searches for the asked ball number and print "Available" if that ball is present or "Not available" if it is not present.

Note: Balls are numbered randomly so use rand() function to generate ball number.

C++

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage