Write a method in your class called reversearray

Assignment Help Data Structure & Algorithms
Reference no: EM131588425

Array Exercises

Create a class named ArrayExercises that contains the following array tasks in the main method:

1. Write some code that asks the user to enter an integer via the keyboard, use that integer to set the length of an array and populate it with random integers from -17 to 19 (inclusive). Print the array back in a nice way (10 numbers per line with commas and such);

2. Below that write some java to reverse the arrays:

char[] a = {'t', 'o', 'y', 'o', 't', 'a'} char[] b = {'r', 'a', 'c', 'e', 'c', 'a', 'r'}

You should do this by creating new arrays to store the reversal. Then write some more java code to prove to me that array b contains a palindrome, while array a does not.

3. (Challenge:) Write a method in your class called reverseArray that is of void return type and it takes as argument a String array (any String array the teacher can think of!) and it reverses the given array in place. That is, it manipulates the given array and modi?es it (this is because arrays are passed in to methods by reference and not by value.

Reference no: EM131588425

Questions Cloud

The responsibilities of a debtor in possession : The responsibilities of a debtor in possession include ________. CAFTA is
Prepare a budgeted income statement for the month of july : Following information relates to Acco Co. Beginning cash balance on July 1: $50,000. Prepare a budgeted income statement for the month of July
Calculate the reorder point in units for kabelo business : Calculate the economic order quantity for Kabelo’ business. Calculate the reorder point in units for Kabelo’ business.
What is the frequency of the fundamental : What is the frequency of the fundamental and the second harmonic - If the tension in the clothesline is increased
Write a method in your class called reversearray : Write a method in your class called reverseArray that is of void return type and it takes as argument String array (any String array the teacher can think of!).
How can taxes affect the firm optimal capital structure : How could bankruptcy costs affect a firm’s WACC? How can taxes affect the firm’s optimal capital structure?
Discuss the ethical and legal concerns of brians actions : Discuss the ethical and legal concerns of Brian's actions. What might the ramifications or consequences of his actions be? Why?
What is the distance covered on the return trip : What is the distance covered on the return trip, as measured by the astronaut? Give your answer in light-years.
Determine the number of occurrences : Write a script that inputs several lines of text and a search character and uses String method index of to determine the number of occurrences of the character.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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