Question
Hello, I need help with scheme programming. in this program, the input is number of lines. and output is how many points are at that
Hello, I need help with scheme programming.
in this program, the input is number of lines. and output is how many points are at that number.
for example (line1)--------1 . (line 2)-------2 .. (line 3)-------4 .... (line 4)-------8 ........ (line 5)-------16 ............... and so on...
(define (line n) (if (= 0 n) 0 (if (= 1 n) 1 (expt 2 (- n 1)))))
but the question is that
I need to modify this code so it could be a reverse program that I have above.
an example is if input will be (5, 6, 7, or 8) points output will be line 4
another example could be (9, 10, 11, 12, 13, 14, 15, or 16) points output will be line 5
and so on....
Thanks a lot.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started