JAVA PROGRAMMING PRACTICAL TEST
Star Pattern Programs (15 Questions with Sample Output)
Student Name: ________________________________
Roll No: ________________________________
Class/Section: ________________________________
Instructions:
• Write separate Java programs for each question.
• Use loops only (for / while / do-while).
• Take input 'n' from the user wherever required.
• Maintain proper indentation and formatting.
Q1. Right Triangle
*
**
***
****
*****
Q2. Inverted Right Triangle
*****
****
***
**
*
Q3. Right Triangle (n=4)
*
**
***
****
Q4. 5x5 Square
*****
*****
*****
*****
*****
Q5. Increasing Space Pattern
*
*
*
*
*
Q6. Pyramid
*
***
*****
*******
*********
Q7. Inverted Pyramid
*********
*******
*****
***
*
Q8. Hollow Square
*****
* *
* *
* *
*****
Q9. Hollow Triangle
*
**
* *
* *
*****
Q10. Diamond
*
***
*****
*******
*********
*******
*****
***
*
Q11. Floyd’s Triangle (Stars)
*
* *
* * *
* * * *
* * * * *
Q12. Right Side Inverted
*****
****
***
**
*
Q13. Butterfly
* *
** **
*** ***
********
********
*** ***
** **
* *
Q14. Hollow Diamond
*
* *
* *
* *
* *
* *
*
Q15. Sandglass
*********
*******
*****
***
*
***
*****
*******
*********
Evaluation Criteria:
Criteria Marks
Logic Correctness 12
Loop Usage & Nesting 8
Code Structure & Readability 5
Input Handling 5
Total 30