Graderpractice for programmers

254275 OOP - Lab2 Extra Sec 3 Loops and Conditionals 2/2563

Awaiting submission
The sequence of square numbers is 1^2, 2^2, 3^2, 4^2, ..., n^2. Read in the number n and print out the sequence of square numbers up to the n-th item.
Awaiting submission
Write a program to get 2 integers with out space n and m values respectively, and then have the program display numbers in the range 1 - n that are evenly divisible by m.
Awaiting submission
Level up Read in 2 integers (one on each line) and then print out all the numbers between the 2 numbers
Awaiting submission
Write a program that inputs 4 numbers and returns the smallest and the highest.
Awaiting submission
A prime number is a positive integer that has two positive divisors, 1 and itself. For example, 7 is a prime. Since it can only be formed by 1 * 7 (itself), 8 is not prime, because8isnotformedbyonly1*8,2*4canalsocause8,etc. Students write a program to check the prime value by accepting an Input as an integer - display the 'Y' result if that number is a prime number. If not, display the 'N' result.
Awaiting submission
Print the Fibonacci sequence. The number of items to print is determined by an integer read in on the input. If the input is 0 then print nothing.
Awaiting submission
Level up Write a program count whitespace in string
Awaiting submission
Read in a string, count how many comma (",") in the string and print out the result
Awaiting submission
Level up Draw a diamond shape using forward and backward slashes. The input is a positive integer that is the length of one side of the diamond shape.

Java Hint: To print a backward slash: System.out.print("\\");

Awaiting submission
The magic of the color write a program to say that the message was received from the keyboard. Is it a preset color? This includes red, blue, green, black, white and yellow only.
Awaiting submission
write a program to receive values ​​from the user through the keyboard until the user enters -1, then the program will tell you the top 2 values ​​in descending order.
Awaiting submission
Level up Write a program that reads in a number to draw a Christmas trees