Printing the pyramid pattern of stars is a common practice in learning any programming language. In this post, we will learn how to print the pyramid pattern of stars in Java. The program output for a pyramid of ten lines of stars is provided below. Video lecture explaining how to print a pyramid of stars […]
About M. Shahriar Hossain
I am an Associate Professor in the Department of Computer Science at the University of Texas at El Paso (UTEP). My specialization is Data Science (Data Mining and Machine Learning.)
Entries by M. Shahriar Hossain
Java do-while loop is one of the three looping techniques available with the language. The other two loops are: for loop and while loop. do-while is a little bit different than for or while loops. In the “for” or “while” loop, generally, a condition is checked in the beginning to realize whether the execution should […]
Nested looping refers to a loop inside another loop. Many applications require to loop over a repeated task. Nested looping is a solution to aid such repetitive tasks. As an example, consider printing ten lines on the terminal, where each line contains twenty asterisks, as shown below.
In the previous video lecture, we learned how to repeat a segment of code using a for-loop. The segment we used for repetition was small. In the following video lecture, we incorporate an if-else structure inside the scope of a for-loop. We use a simple problem to develop this practice scenario. The Problem used in […]
Repetition of segments of codes is an essential part of programming. Repeating the execution of a code segment, a programmer can reduce the size of the code as well as solve problems that require iterations of similar computations for an arbitrary number of times. Java provides three syntaxes for repetition: for loop, while loop, and […]
In the previous video-lecture, we described how if-else if-else statements work. We provided an exercise with the video-lecture. In the video with this article, we provide a solution to the exercise. Tracing a program with if-else if-else statements In the following video, we introduce a technique called tracing that we did not cover before. Tracing […]
The article is about teaching kids math with a focus on problem-solving.
The article explains if-else if-else control statements in Java. It provides a video and relevant exercises.
A boolean variable is capable of holding either “true” or “false.” A computer program may use one bit only to store the status “true” or “false.” You might already know that the smallest memory unit of the computer is a “bit.” Therefore, a boolean variable uses as little memory as possible to store the information […]
The article describes the arithmetic operators in Java programming language. It provides a video lecture, which uses simple programming examples to explain the concepts.