Question: (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

 (50pts) Write a Java program A1p1.java with a public class A1p1

(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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!