Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(50pts) Write a Java program A1p1.java with a public class A1p1 and no named packages that takes one command line argument assumed to be a

image text in transcribed

(50pts) Write a Java program A1p1.java with a public class A1p1 and no named packages that takes one command line argument assumed to be a positive integer n. The program should prompt the user to input n integers from stdin (one per line) and store all of them in an array. After the program reads in the input integers, it should print these integers in original order and store their squares in reverse order in the same array. Then the program should print the squares in the array (from first to last). Two sample runs can look like thle following (blue color means those are typed by the user): [kwanghcomputer] [ /temp] \$ java A1p1 4 2 8 5 12 The original integers are: 2,8,5,12 The squares in reverse order are: 144,25,64,4 [ kwadgdeomputer [ /temp] $ java A1p1 3 2 3 7 The original integers are: 2,3,7 The squares in reverse order are: 49,9,4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions