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:
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started