Create function to rotate the array

Assignment Help JAVA Programming
Reference no: EM132084316

Note: This is an introduction course for Java. Please be considerate.

Problem :

Write a program that allows users to input an integer for the size of an array. Randomly generate an integer for each element of the array. Next, create function to rotate the array .

Rotation of the array means that each element is shifted right or left by one index, and the last element of the array is also moved to the first place.

For example:

Enter the number of slots needs in the array: 8

This is element of your array: 91 57 18 96 16 49 31 83

Which direction to shift R/L : R

How many times: 2

This is element of your array: 31 83 91 57 18 96 16 49

For example:

Enter the number of slots needs in the array: 3

This is element of your array: 31 83 91

Which direction to shift R/L : L

How many times: 2

This is element of your array: 91 31 83

Please do not use any advanced syntax. This is an introduction course.

Reference no: EM132084316

Questions Cloud

Write a program that has a function prototype : Write a program that has a function prototype before main and an implementation of the function after main.
Create an abstract class vehicle that has the methods : Create a derived class BoatPlane that inherits from Boat that adds the appropriate fields and overloads the appropriate functions.
What is the pvalue : Consider testing Upper H0= : H0: µ=20 against Ha: µ
What is the probability that a particular flight will carry : What is the probability that a particular flight will carry between 455 to 460 and passengers?
Create function to rotate the array : Write a program that allows users to input an integer for the size of an array. Randomly generate an integer for each element of the array.
What are the objectives of worker compensation laws : What are the objectives of worker's compensation laws? How do you describe the employers' obligations under these laws?
Show the number of clock cycles that is needed : Show how you can convert the class B machine (Moor) to class A (Mealy) to improve the number of flip-flops and cut down on the cost.
Development action plan supporting leadership development : Identify and develop a development action plan supporting a leadership development goal using a SMART goal and coming up with an action plan.
In business is withholding information for your advantage : In a business is withholding information for your own advantage the same as lying? why or why not.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a java program using the java graphics

Your task for this assignment is to write a Java program using the Java Graphics class to create an example of a computer generated image. This is an opportunity for you to explore computer graphics and exercise some individual creativity.

  Compute the total annual compensation of a salesperson

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: A salesperson will earn a fixed salary of $35,750

  Which allows to input a year and when hit the check button

Create a JAVA GUI (With Frame), which allows to input a year and when hit the check button, will show the picture of Chinese zodiac animal! I am trying to make a calculator: i have the method for or the calculation method to show how to calculate:

  You are a mighty warrior and armed with your trusty bow and

you are a mighty warrior and armed with your trusty bow and 3 arrows you enter the caves in search of the mighty

  Describe script or scripting tool

Describe script or scripting tool

  A method and using a synchronizedblock

What'sthe difference between synchronizing on a method and using a synchronizedblock?

  Write a program to track their hotel occupancy for hotels

The Paris Hotels Company needs a computer program to track their hotel occupancy for the hotels in their chain. Write a Java program that calculates the occupancy rate for each floor of a hotel.

  Practice of using a network of remote servers

What is the name given to the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.

  What are the fields in the node class

The LinkedList class uses another class called Node (which is defined inside LinkedList.java). What are the fields in the Node class? The Node class uses generics. Why?

  Create an overloaded constructor that provides values

Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are + and -).

  A java program for the diffie-hellmann key exchange

Compute and print the values of p, the generator g, random numbers a,b Z* p, and other intermediate results computed in the Dife-Hellman protocol.

  Have an array of integers with user input instead of given

change the current code to have an array of integers with user input intead of given input from the main where it says int[] a=....; And also from a text file but the same numbers as what is given in main.

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