subject

Write a Java program that creates the following matrix by adding 3 to the previous value, then displays it. This is another program that doesn't seem very useful. However, later on in the course, when we get to two-dimensional arrays, you'll use techniques like this to get row totals, column totals, and grand totals as you go through real data. So start small now. Specifics: 1. Code this as a single main() method (i. e., do not use any additional methods for this problem). 2. Notice the starting value is 0. Use an accumulator variable to store and manage the value being displayed. Don't try to use column or row position—just start at 0 and keep adding 3 each time you output something. 3. The matrix has 6 rows and 4 columns. Allow for a fixed width of 6 horizontal columns for each value in the display. Notice the digits are right aligned. Use printf to do this. Go back to earlier notes, Notes 3, or look it up online. 4. Sample output follows. Don't display the yellow line and its values—just the rows below it. It's only there to help you visualize how to line things up and construct your printf statement: 012345012345012345012345 0 3 6 9

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:20
Write a pseudocode solution for each of these problems. 1. design a while loop that lets that user enter a number. the number should be multiplied by 10, and the result stored in a variable named product. the loop should iterate as long as product contains a value less than 100. 2. design a do-while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed. the loop should ask the user whether he or she wishes to perform the operation again. if so, the loop should repeat; otherwise it should terminate. 3. design a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 100. 4. design a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row. 5. convert this for loop to a while loop. declare integer count for count = 1 to 50 display count end for 6. find the error in the following pseudocode. declare boolean finished = false declare integer value, cube while not finished display “enter a value to be cubed.” input value; set cube = value ^ 3 display value, “ cubed is “, cube end while
Answers: 2
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
You know the right answer?
Write a Java program that creates the following matrix by adding 3 to the previous value, then displ...
Questions
question
Social Studies, 15.10.2019 22:00
question
Social Studies, 15.10.2019 22:00
question
Mathematics, 15.10.2019 22:00
Questions on the website: 13722360