Define suitable classes to handle the web service requests

Assignment Help Computer Engineering
Reference no: EM133422752

Building RESTful Web Services for Fibonacci Sequence Operations Using Spring

Preface
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding numbers. The sequence starts with 0 and 1, and each subsequent number is the sum of the two previous numbers. The sequence continues infinitely and goes as follows: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, and so on. The sequence is named after Leonardo Fibonacci, an Italian mathematician who introduced the sequence to the Western world in his book Liber Abaci, which was published in 1202. The Fibonacci sequence has many interesting mathematical properties and has been observed in various natural phenomena, such as the branching of trees and the spirals in shells.

Question
In this assignment, you will be building a set of RESTful web services using Spring that will allow clients to perform several operations related to the Fibonacci sequence. The web services will be able to generate the Fibonacci sequence up to a specified number, generate the nth number in the sequence, calculate the sum of the first 6 numbers in the sequence, and check if a given number is a member of the sequence.

Technical Tasks to do:

1. Start by creating a new Spring project in Spring Tool Suite (STS) or your preferred IDE, and then define suitable classes to handle the web service requests.

2. Implement the genFibonacci(n) web service to generate the Fibonacci sequence up to a specified number 'n' provided by the user in the URL. This should be done using a loop that generates each number in the sequence until the number exceeds the specified limit. A valid URL can be in the form of
localhost:8080/assignment2/services/fiborestservice/genfibonacci/n
where 'n' is an integer that satisfies 0 ≤ n < 100.

3. Implement the genFibo(n) web service to generate the nth number in the Fibonacci sequence, where n is a number provided by the user in the URL. This should be done using a loop that generates each number in the sequence until it reaches the nth number. A valid URL can be in the form of
localhost:8080/assignment2/services/fiborestservice/genfibo/n
where 'n' is an integer that satisfies 10 ≤ n ≤ 20.
pg. 2

4. Implement the calcFib6Sum web service to calculate the sum of the first 6 numbers in the Fibonacci sequence. This should be done using a loop that generates each number in the sequence and adds it to a running total until it reaches the 6th number. A valid URL can be in the form of
localhost:8080/assignment2/services/fiborestservice/calcfib6Sum

5. Implement the chkFib(n) web service to check if a given number 'n' is a member of the Fibonacci sequence. This should be done by generating each number in the sequence until the number is greater than n, and then checking if the last generated number in the sequence is equal to the given number. A valid URL can be in the form of
localhost:8080/assignment2/services/fiborestservice/chkfib/n
where 'n' is a non-negative integer excluding zero.

6. Ensure that the web services can produce and consume JSON objects.

7. Handle invalid data exceptions by using appropriate exception handlers in Spring. This should be done for all the web services where invalid input data exception handling makes sense.

8. Enrich the security of the web service by adding Basic Authentication. This will require clients to authenticate themselves using a username and password before they can access the web service.

9. Test all the developed endpoints in Postman to ensure that they function as expected.

Reference no: EM133422752

Questions Cloud

What is a concentration gradient : What is a concentration gradient? Define the terms hypotonic, isotonic, and hypertonic. Explain the direction of the solute and the solvent in each case.
Select a phylum from lophotrochozoa and discuss : Select a phylum from Lophotrochozoa and discuss. Name three classes of the Arthropoda and their characteristics (give an example per group).
Discuss the thermoregulatory risks of exercise : Discuss the thermoregulatory risks of exercise that are exacerbated by advancing age. Why are older people more prone to these issues?
Estimate how many parking spaces should be provided : Estimate approximately how many parking spaces should be provided at the garage. Justify your reasoning, possibly with reference to some queueing theory model
Define suitable classes to handle the web service requests : Start by creating a new Spring project in Spring Tool Suite (STS) or your preferred IDE, and then define suitable classes to handle the web service requests
What is sarcopenia : Sarcopenia is one of the early signs of frailty. What is sarcopenia? Loss of muscle mass Loss of cognitive ability Bone weakness Difficulty
What are some of the reasons for the fall of tenochtitlan : Who, what, where, when, and how: What are some of the reasons for the Fall of Tenochtitlan? Please be specific and explain these reasons.
Describe how to isolate, identify and culture a stem cell : Describe how to isolate, identify and culture a stem cell type, focusing on the protocol and culture conditions in 10-15 steps/bullet points.
What is the phenotype and genotype ratios that result : What is the phenotype and genotype ratios that result if you cross a white mouse with a gray mouse?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd