Allan Hancock College Java Programming Project

Description

1 attachmentsSlide 1 of 1attachment_1attachment_1

Unformatted Attachment Preview

this is the first file
import java.util.Random;
//—————————————————————————// DO NOT MAKE ANY CHANGES TO THIS CLASS
//
// Any changes you make to this class will not be used for grading.
//—————————————————————————public class Main
{
public static void main(String[] args)
{
Random prng = new Random();
int min, max;
// random bounds by default
min = prng.nextInt(50);
max = prng.nextInt(50) + 50;
// override with command line args
if (args.length >= 2)
{
try
{
min = Integer.parseInt(args[0]);
max = Integer.parseInt(args[1]);
}
catch (Exception e)
{
System.err.println(“Command line arguments threw an
exception!”);
System.exit(1);
}
}
// create object
Sequence seq = new Sequence(min, max);
// use class
System.out.println(“Sequence bounds:”);
System.out.println(min + “, ” + max);
System.out.println(“Sequence listed:”);
printArray(seq.list());
System.out.println(“Sequence backwards:”);
printArray(seq.backwards());
System.out.println(“Sequence evens:”);
printArray(seq.evens());
System.out.println(“Sequence squares:”);
printArray(seq.squares());
System.out.println(“Sequence summation:”);
System.out.println(seq.summation());
}
public static void printArray(int[] stuff)
{
for (int x : stuff)
System.out.print(x + “, “);
System.out.println();
}
}
this is the second file
public class Sequence
{
private int mMin = 0;
private int mMax = 0;
public Sequence(int min, int max)
{
//TODO: assign the arguments to the class member variables
}
public int[] list()
{
//TODO: return array of the consecutive integers between the bounds
(inclusive)
// i.e. the first number is the min bound and the last number is the
max bound
return new int[0];
}
public int[] backwards()
{
//TODO: return array of the consecutive integers between bounds in
descending order
// i.e. the first number is the max bound and the last number is the
min bound
return new int[0];
}
public int[] evens()
{
//TODO: return array of only even integers in the sequence
// the array should be the exact correct size containing only the
even numbers
return new int[0];
}
public int[] squares()
{
//TODO: return array of sequence integers squared
// i.e. square each integer in the sequence
return new int[0];
}
public int summation()
{
//TODO: return the summation of the sequence
// i.e. add all the sequence integers together and return the result
return 0;
}
}

Purchase answer to see full
attachment

Tags:
computer science

java programming

Programming Code

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Reviews, comments, and love from our customers and community:

Article Writing

Keep doing what you do, I am really impressed by the work done.

Alexender

Researcher

PowerPoint Presentation

I am speechless…WoW! Thank you so much!

Stacy V.

Part-time student

Dissertation & Thesis

This was a very well-written paper. Great work fast.

M.H.H. Tony

Student

Annotated Bibliography

I love working with this company. You always go above and beyond and exceed my expectations every time.

Francisca N.

Student

Book Report / Review

I received my order wayyyyyyy sooner than I expected. Couldn’t ask for more.

Mary J.

Student

Essay (Any Type)

On time, perfect paper

Prof. Kate (Ph.D)

Student

Case Study

Awesome! Great papers, and early!

Kaylin Green

Student

Proofreading & Editing

Thank you Dr. Rebecca for editing my essays! She completed my task literally in 3 hours. For sure will work with her again, she is great and follows all instructions

Rebecca L.

Researcher

Critical Thinking / Review

Extremely thorough summary, understanding and examples found for social science readings, with edits made as needed and on time. Transparent

Arnold W.

Customer

Coursework

Perfect!

Joshua W.

Student

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>