Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
UserDefinedBar
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' //write a program that reads some numbers, each between 1 and 30.For each number read your program should draw that number of adjacent hearts; //bar code credit goes to H.P. Deitel and P.J. Deitel, Deitel & Associates Inc //remaining parts of the codes are created by Rezaul Hoque on September 26,2021;contact: jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; import java.util.Scanner; class Rextester{ public static void main(String args[]){ Scanner input=new Scanner(System.in); System.out.println("Enter size of the arrays:\n"); int size = input.nextInt(); int a[] = new int[size]; System.out.println("Enter " + size + " numbers between 1 & 30:\n"); for (int i = 0 ; i < a.length; i++ ) { a[i] = input.nextInt(); } String display= "Number\t"+" Horizontal Bar"; for(int l=0;l<a.length;l++){ display +="\n"+a[l]+"\t"; for(int k=0;k<a[l];k++) display +="❤"; } System.out.println(display); input.close(); } }
run
|
edit
|
history
|
help
0
Java - SimpleDateFormat(ting)
Complex number multiplication (leetcode)
sortArraymerge
laba3
Print String in Reverse
Jagpreet Bajwa
single_digit
Meena
Factorial using recursion in java
inheritance