marți, 11 decembrie 2018

c++ programming part five






Basics of Sorting Algorithm and their code in java
Getting started with GUI -

Guess the number project
Snake project
.........................
504.
505. Requirements
PC are fine for this course
A course completely for beginners
Description
The biggest issue with Java is that most people either say that before learning
Java you should know C n C++ or they teach Java like they are teaching to some
professionals. That's not the case with this course.
Hi, Welcome to complete Java Bootcamp for beginners. A course that teaches you
Java assuming you have no prior programming experience and takes you to a level
where you can understand typical use cases and algorithms to design code for them in
Java.
About me
My name is Boroghina Bogdan and I have been programming for almost 32 years. I
wrote books, seminars at Pietta Glass in Valeni, seminar online on skype in Praga,
video tutorials on udemy, youtube, i wrote software for prominfo and many other's
company, and i sell all of these on zumzi, and not only. Soon, i will be ready to sell all
of these in spanish, english and italian, and why not, in france and cuban language.
Now i'm writting an ebook about OOP and Java, and i'm writting a software who write
Java application, and I develloping AM languages, which includes all other
languages. Thank's to Miruna Andreea Boroghina, who is my daughter and absolutely
lovely, and to Andreea Boroghina, my ex-wife, who support me, financial and moral,
many times. Thank's again!
Email: centruldoxis@gmal.com
506. Decisional Statements.
507. We'll learn how to make a decision-making program.

508. The simplest way to program a behavior is to you say: "If a condition is true,
then execute statements ".
509. Here's the simple form of the if statement:
510. if (condition)
511. statement;
512. Example:
513. if (a == b)
514. cout << "a is equal to b";
515. cin>>n;
516. cin>>m;
517. int s=n+m;
518. cout<<"the sum between <<<<"and"<519. int a=1101,b=23,s,p;
520. double d;
521. s=a+b;
522. cout<<"sum is <523. p=a*b;
524. cout<<"product is "<
525. d=(a*1.0)/(b*1.0);
526. cout<<"division is "<527. }
528. We notice that we used the equal sign twice. When we want to test an equality
we always have to use the operator ==.
529. The if statement also has the compound version:
530. if (condition) {
531. statement-1;
532. statements-2;
533. ..............
26 advice
go fishing
534. statements-n;
535. }
536.
537. What's the difference?

538. Different is the fact that in the second example braces are used.Simple form of if
executes only one statement on when the one with braces executes two or more.
539. What role are the braces?
540. Braces have the role of creating a block of statements that is to be executed if
the condition is true, whereas if we do not have braces it will only runfirst statement
following if.
541. The if statement also includes an optional, optional branch.
542. General form:
543. if (condition) statement 1;
544. else
545. statement 2;
546. If the condition is true then run statement 1, otherwise execute statement 2.
547. Example:
548. if (5> 3) cout << "true! "
549. else cout << "false";
550. If 5> 3 then we write "true!", Otherwise we write "false".
551. Example:
552. a = 7;
553. b = 4;
554. c = 2;
555. if (a> b + c)
556. cout << "a is greater than b + c";
557. else cout << "is not greater than b + c";
558. We have assigned values ??for variables a, b and c. If a> b + c then we
27 advice
take a complete clock and try to place the
pieces differently
showed "a is larger than b + c", otherwise we would say "is not greater than b + c ";
559. Example:
560. if (a == b)
561. cout << "a is equal to b";

562. else
563. cout << "is not equal to b";
564. C ++ relational operators are:
565. <- nbsp="" p="" smaller="">566. > - Higher
567. <= - less than or equal
568. > = - greater or equal
569. == - checking equality
570. ! = checking inequality
571. Let's take as an example a program that shows us if one
572. number is odd or not odd:
573. #include  
574. int main () {
575. int x;
576. cout << "Enter a number:";
577. cin >> x;
578. if (x% 2 == 0)
579. cout << "The number is not odd.";
580. else
581. cout << "The number is odd.";
582. return 0;
583. }

584. In this program we used the modulo operator (%). How I said, this operator
returns the rest of the split, and if the remainder of the division of a number to 2 is
0, that means that the number is not odd, and otherwise it is odd.

Niciun comentariu:

Trimiteți un comentariu

Rețineți: Numai membrii acestui blog pot posta comentarii.