Showing posts with label Statements. Show all posts
Showing posts with label Statements. Show all posts

Java Video Lessons - using loop and control statements WHILE, FOR, DO WHILE and SWITCH


This video is from the New Boston project: http://thenewboston.org/ , made by Bucky Roberts.
We just find the best Java video lesson for your.

In this video tutorial, Buckey will teach us more about the loops and control statements in Java.

Game: Guess the number raffled by the computer



How to make a game in Java, just using one method, if else conditional test, do while control statement and Random and Scanner classes.Play a game is very good and fun... but playing a game that you have created, is a pleasure that just a few have.
The Java programming language is known to be widely used for creating games. Most likely you've played a game, even online ones, are done in Java.

Based on the knowledge gained in our online course of Java, it is possible to create a game.
Although very simple, it is quite genious and cool.

The computer will randomly select a number between 1 and 1000 and you have to guess what number this is.
Each round you enter a number and the computer will give you the tips, saying the number you typed is greater or less than the number it choose.

Ends when you hit, and he keeps the number of attempts you made. Can you beat your own record?
You know what's the best strategy?

App: Simple menu using methods, loops and switch

How to make a simple menu in Java, using methods, loops and switch statement commandUsing a method to display a menu of options

Focusing on the goal of our Java course, and show that it is doing useful things, we show a utility method that simply display messages on the screen.

Program that says how many days the month has


Programa em Java que recebe o mês e informa quantos dias ele possui.Exercise:

Create a Java program that receives an integer of 1 to 12, representing the months of the year and return the number of days in the month.
Use switch and not use 'case' in it.
Use accumulation case.




Problems involving control statement: if, else, while, for, do while and switch

Say 'use it' or 'use it' is easy.
Problemas envolvendo laços | Java ProgressivoNow test your creativity Javeana and invent your own way to solve the following problems, but remember to use:

to exercise your learning.

The command switch: making choices in Java


In the article about the while loop in our online Progressive Java course, we show how to create a simple menu.
But Java has a specific feature for this purpose, which allows us to choose something, depending on what we typed, is the command switch.

The break and continue commands: interrupting and changing flows and loops


In this part of our online Java Course we will see the break and continue commands, Java, which serve to provide us with greater control over the flow of applications, especially the iterations of loops.

Loop do while: the control statement that always happens...at least once


We will see in this article another important loop in Java, do ... while loop that always executes the code of the loop at least once, regardless of the condition of the while being true or false.

Commented and explained code of Minesweeper game in Java



We will now explain in detail how to do, and understand all program logic of a minesweeper game in the Java programming language.

The game code is on our last article of our online course Java:
Game: How to make a Minesweeper in Java



Flux Control


Loopings, Flux and Statements Control

01. How to use IF and ELSE: Testing and Controlling which will run
    Application: Say if you got straight approval, or have to do recovery test or failed
    Application: Determines the roots of a second degree equation
    Video lesson: Java Video lesson - How to use the conditional test IF ELSE
02. Questions about IF ELSE use
03. Math Operators Increment (++) and Decrement (--)
04. Assignment Operators: +=, -=, *=, /= and %=
05. Assignment operators and increment and decrement: differences between a=b++ and a=++b
06. The while loop: what it is, how to use and calculating AP and GP series with while
07. Infinite loop, controlling loops and loops with while statement
    7.1 Exercises about the while looping
08. Control Statement for: having better control over repetitions
    8.1 Exercises about control statement for
09. The do while loop: the control statement that always happens..at least once
10. The break and continue commands: interrupting and changing flows and loops
11. switch command: makind choices in Java
12. Problems involving control statement: if, else, while, for, do while and switch
      Exercise: Program that says how many days the month has
      Video lesson: using loop and control statements WHILE, FOR, DO WHILE and SWITCH

Game: How to program the Battleship game in Java

Battleship game in Java: How to program


How to make a Battleship game in Java. Commented and explained code in step-to-step for Java beginnersNow, that we already learned how to pass arrays (of any size) for methods, we can do something more useful. Let's do the famous game called naval battle, in text mode.

We use everything we have learned so far in our Java course: if else, while loop, loop, methods, random numbers, arrays, multidimensional arrays and creativity.

Question: program that generates 20 numbers between 1000 and 1999 and shows that leave the rest in division 5 of 11


Build a Java application to generate 20 numbers from 1000 to 1999 and show those that divided by 11 let rest 5.

Control Statement for: having bettter control over the repetitions


We will now see the most important and used Java control statemente, which is always seen in our course code: the for loop

His fame is due to the power we have because of the details that the loop is able to receive, and you can have more control over the repetitions.

Infinite loop, controlling loops and loops with while statement


Use looping statements often can be a dangerous task.
This is because of a thing called an infinite loop.

It happens unintentionally, but sometimes it happens on purpose ... mainly by bad intentioned people.
In this Java article we study more about this type of loop, how they occur, and how  have more control over the loopings statements.

The while loop: what it is, how to use and calculating AP and GP series with while


In recent articles we learned several operators and shortcuts used by Java programmers, such as ++, --, +=, -=, *=, /= and other.

It's time to put them in action and learn one of the most important commands in any programming language: the control statements

In this article, we'll explain what it is and how to use the while loop.