Set the length of an array and populate it with random int

Assignment Help Computer Engineering
Reference no: EM132169206

Using JAVA

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 modifies i.

Reference no: EM132169206

Questions Cloud

Create a gui application that allows the user to enter : Create a GUI application that allows the user to enter the total sales for the month into a text field.
Create a personal set of web pages on any topic : Create a personal set of Web pages on any topic that you like. Use CSS to provide a consistent style to your pages.
Using the graphical user interface create a user named cmit : Verify the program starts when CMIT140 logs into the system by logging out and then logging back in as CMIT140.
Draw a line using point draw and bresenhams line algorithm : To program a graphics program the first thing to consider is the display window (or canvas) itself. This is specified and implemented using library functions.
Set the length of an array and populate it with random int : 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.
Create an erd crows foot diagram showing the entities : Create an ERD crows foot diagram showing the entities and the relationships between them with cardinalities.
Define the image as a matrix a using the imread function : Define the image as a matrix a using the imread function. What is the height and width in pixels?
Write a method in your class called reversearray : 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.
Design a vending machine that takes coins : Design a vending machine that takes coins of 1, 5, 10, and 25 cents. Ask the user what he wants to purchase, by selecting for a Coke.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How can u make sure that the destructor of derived

How can u make sure that the destructor of Derived is always called when a dynamic Derived is pointed by base's pointer?

  Create any spreadsheet of your choice

Create any spreadsheet of your choice, but use the sum function and show that you can divide numbers to show an average. Be sure to include internet research for some of the data in your spreadsheet.

  What do you mean by wimax describe why mobile wimax is an

directions please provide detailed and elaborate responses to the following questions. your responses should include

  Analyze how the data breach could have been prevented

Analyze how the data breach could have been prevented with better adherence to and compliance with regulatory requirements and guidelines.

  Obtain the boolean expressions

Obtain the Boolean expressions for the following circuit

  Relationship between programming languages and applications

The consultants suggested using object-oriented technology. still the internal information systems team was hesitant to use object-oriented technology. They instead suggested using structured programming.

  What are the essential benefits of using a qfd approach

What are the essential benefits of using a QFD approach to product design? How are CAs prioritized?

  What is the difference between a region and a segment

Capabilities in Chorus use epoch numbers in their Uls. Why? What is the difference between a region and a segment?

  Write a program which asks the user for two numbers

Write a program which asks the user for two numbers and calculates the first number raised to the second number.

  Implement constraint satisfaction problem - Sudoku Puzzles

CS 550 - Artificial Intelligence Assignment contains a partially implemented constraint satisfaction problem class for solving Sudoku puzzles

  Estimating the output

Provided: enum cropType {WHEAT,CORN,RYE,BARLEY,OATS} cropType crop;

  Program the user types an item number and a quantity

I need a program for a mail-order company. The program uses a data-entry screen in which the user types an item number and a quantity. Write each record to a file. Save program as MailOrderWrite.java

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