Problem Description 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".

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 22PE
icon
Related questions
Question
  1. Problem Description

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".



Input

A line containing two integers separated by a space.

777·7

Output

A line containing a string.

Jackpot!

 

-USED JAVA PROGRAMMING LANGUAGE 

1. Problem Description
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".
Input
A line containing two integers separated by a space.
777:7
Output
A line containing a string.
Jackpot!
Transcribed Image Text:1. Problem Description 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". Input A line containing two integers separated by a space. 777:7 Output A line containing a string. Jackpot!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 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