Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah". Let's try this out now! Input A line containing two integers separated by a space. 777 7 Output A line containing a string. Jackpot!

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 21PE
icon
Related questions
Question
4. Java
4. Jackpot!
by CodeChum Admin
Did you know that in lotteries, a 3-digit number
with the same numbers in all digits like 777 will hit
the jackpot in a casino? In the same manner, let's
make a program that will test if a certain 3-digit
number hits a jackpot or not by identifying if all the
digits of a given number is the same as the
second inputted number. If it is, print "Jackpot!";
else, print "Nah".
Let's try this out now!
Input
A line containing two integers separated by a
space.
777 7
Output
A line containing a string.
Jackpot!
Transcribed Image Text:4. Jackpot! by CodeChum Admin Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah". Let's try this out now! Input A line containing two integers separated by a space. 777 7 Output A line containing a string. Jackpot!
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
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