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

  Compare the merits and demerits of 3g and 4g technology to

there are a number of cellular phone companies each serving their own unique geographical areas. likewise they each may

  Write a java program to read a string from the user

Write a Java program to read a string from the user at the command line and then check that the password conforms to the corporate password policy.

  Write a function that will return the mean of the values

Write a function that will return the mean of the values in a vector, not including the minimum and maximum values.

  Write a python script to generate 50 files for each

Write a python script to generate 50 files for each of the following courses: MATH222, MATH477, MATH333.

  3d animation using in object modelling and methods

Ngaruwahia Golf Course sits on the banks of the mighty Waikato River. This club is an easy 10 minutes' drive north of Hamilton and an hour's drive south of central Auckland along State Highway1.

  How digital forensics were used in the investigation

Using WORD, write an ORIGINAL brief essay of 300 words or more describing the case and the how digital forensics were used in the investigation.

  Write the function dropodd

CIS 623 Syracuse University write the function dropOdd which, take a list xs as input, removes all the elements from the list where their positions are odd

  Implement a calculator for a client-server architecture

Implement a calculator for a client-server architecture using socket communication between the client and the server.

  How many cycles per second does the processor spend

How many cycles per second does the processor spend handling interrupts and processing requests from the device?

  What is the degree p of this polynomial

What is the best choice (i.e. minimizing the interpolation error) of points x1,x2,x3,x4,x5,x6? Give the formula for xi and using Matlab produce a table.

  Derive all four forms of minimum two-level circuits

Derive all four forms of minimum two-level circuits for P and Q in problem. Problem: For the circuit shown below: For the circuit shown below, express P and Q.

  Discuss ideas about the usefulness for the it manager

Review and summarize your ideas about the usefulness for the IT manager of a) a glossary that defines terms; b) the course readings; and c) working on a team.

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