8) Write a segment of code (not a whole program) that sets the elements of a two
ID: 3721635 • Letter: 8
Question
8) Write a segment of code (not a whole program) that sets the elements of a two-dimensional (10 by 10) array called map as follows: the top and bottom rows and the left-most and right-most columns contain the value 0, all other elements (the "inside" ones) contain the value 99.
9) Write a class called Squares that reads in 50 positive or negative whole numbers from a file (e.g., 5, 946, -32, 0) and prints out only those numbers that are perfect squares (a number N is a perfect square if there is some positive whole number S such that S*S = N). For example, 0,1,4,9,16,25,36, etc. are perfect squares. 2,3,5,6,7,8,10 etc. are not perfect squares. The program MUST use a non-static method to decide if a number is a perfect square. The main method should just read a number, call the function, then print the number if the function indicates it is a perfect square.
Explanation / Answer
Please find my implementation. of Q9.
Please repost Q8 in separate post
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.