Computers and Technology

Write a method named randomx that keeps printing lines, where each line contains a random number of x characters between 5 and 19 inclusive, until it prints a line with 16 or more characters. for example, the output from your method might be the following. notice that the last line has 17 x characters.(because this problem uses random numbers, our test cases check only the general format of your output. you must still examine the output yourself to make sure the answer is correct.) this is what i got, and can not get it to work import java. util.*; public class randomx{ public static void main(string[] args){ randomx(); } publicstaticvoidrandomx(){ randomrand=newrandom(); intlinescount=rand. nextint(9)+2; for(inti=1; i< =linescount; i++){ intxcount=rand. nextint(15)+5; for(intj=1; j< =xcount; j++){ system. out. print("x"); } system. out. println(); } } }

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, robert7248
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
image
Computers and Technology, 23.06.2019 11:00, la200564
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
image
Computers and Technology, 23.06.2019 22:00, elijah1090
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
image
Computers and Technology, 24.06.2019 05:30, lexie2751
How do i get rid of my member ship for
Answers: 2
Do you know the correct answer?
Write a method named randomx that keeps printing lines, where each line contains a random number of...

Questions in other subjects:

Konu
History, 21.11.2019 02:31
Konu
Mathematics, 21.11.2019 02:31