Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the array called nos (an array of Integer) that will contain the following numbers 1058 null 40 null 1) Write a loop to add
Create the array called nos (an array of Integer) that will contain the following numbers 1058 null 40 null 1) Write a loop to add up all the numbers in nos Note: your code should not result in a crash. 2) Using an enhanced for loop, count how many nulls there are in nos 3) Using a traditional for loop, increase any number in nos that is less than 10 by 5. 4) Make an array of int called backup that should be the same size as nos 5) Copy the elements from nos to backup one by one with a loop, using 0 for any null. 7) Write one line of code to call your method setup so that it creates an array of size 10 and save it in a variable called data. 8) Complete the code Scanner keys = new Scanner(System.in); // read in an int from the user using the Scanner keys // next, create an array of String called lines of the size requested // next, read those number of lines from the user using a for loop and the Scanner keys // finally print out the contents of lines, in capitals with line numbers starting at 1
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