design pesudo code and analyse i

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

design pesudo code and analyse it

Here we describe a guessing the number game. You ask your friend to think of an integer n between 1 and 30 i.e. 1 <= n <= 30. Your friend will not tell you the number. You have
to guess it. However, to help you, he will tell you the values of the given number n modulo the primes 2, 3, and 5. Based on these values you have to guess the number n. To
help you, you can make use of charts containing numbers which give residue of 0 when divided by 2, residue of 1 when divided by 2, residue of 0 when divided by 3, residue of 1
when divided by 3 and so on. Design a pseudocode based on the logic given and analyse the pseudocode.
Transcribed Image Text:Here we describe a guessing the number game. You ask your friend to think of an integer n between 1 and 30 i.e. 1 <= n <= 30. Your friend will not tell you the number. You have to guess it. However, to help you, he will tell you the values of the given number n modulo the primes 2, 3, and 5. Based on these values you have to guess the number n. To help you, you can make use of charts containing numbers which give residue of 0 when divided by 2, residue of 1 when divided by 2, residue of 0 when divided by 3, residue of 1 when divided by 3 and so on. Design a pseudocode based on the logic given and analyse the pseudocode.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Binary numbers
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole