using System; namespace Demo01 { class Program

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Advertisements

Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
For(int i = 1; i
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Copyright © Recursive GCD Demo public class.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Firefly Synchronisation Java Demo in 1D Array. 1 Dimension Firefly in Java two neighbors 1. Initialization: 2.
Loops –Do while Do While Reading for this Lecture, L&L, 5.7.
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Execute Blocks of Code Multiple Times Telerik Software Academy C# Fundamentals – Part 1.
1 Calling within Static method /* We can call a non static method from a static method but by only through an object of that class. */ class Test1{ public.
Tinaliah, S. Kom.. * * * * * * * * * * * * * * * * * #include using namespace std; void main () { for (int i = 1; i
Triana Elizabeth, S.Kom. #include using namespace std; void main () { for (int i = 1; i
1 Repetition structures Overview while statement for statement do while statement.
תכנות ב C#. דוגמא לפלט using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void.
Review. By the end of today you should be able to- Know how to use args Know how to use the JOptionPane Know how to convert a String to a number.
LAB 10.
Mixing integer and floating point numbers in an arithmetic operation.
Indentation & Readability. What does this program do? public class Hello { public static void main ( String[] args ) { //display initial message System.out.println(
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
The Math class Java provides certain math functions for us. The Math class contains methods and constants that can be very useful. The Math class is like.
1 More data types Character and String –Non-numeric variables –Examples: char orange; String something; –orange and something are variable names –Note.
Output Programs These slides will present a variety of small programs. Each program has a control structure that was introduced in this chapter. Our concern.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Chapter One Lesson Three DATA TYPES ©
Programming With Java ICS201 University Of Ha’il1 Chapter 11 Recursion.
Wel come To Seminar On C#.
1 Advanced Programming Examples Output. Show the exact output produced by the following code segment. char[,] pic = new char[6,6]; for (int i = 0; i
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
Catie Welsh February 14,  Program 2 Due Tonight by 11:59pm  Program 3 Assigned 2.
Methods What is a method? Main Method the main method is where a stand alone Java program normally begins execution common compile error, trying.
JOptionPane. Import javax.swing.JOptionPane Use showInputDialog() for input. Only string values can be input. To convert an input value from a string.
Declaring console static and global import java.util.*; public class Test { static Scanner console = new Scanner (System.in); public static void main(String[]
CMSC 150 ARRAYS CS 150: Fri 10 Feb Motivation  Consider a list of your contact addresses: String Zero = String.
Import javax.swing.JOptionPane; public class Rectangle { public static void main(String[] args) { double width, length, area, perimeter; String lengthStr,
Staples are our staple Building upon our solution.
Three kinds of looping structures The while loop The for loop The do (also called the do-while) loop All have equivalent power, e.g., if you can write.
Introduction to Computer Science What is Computer Science? Getting Started Programming.
Introduction of Java Fikri Fadlillah, S.T.
Introduction to programming in java
התוכנית: using System; using System.Collections.Generic;
Advanced Programming TA Session 2
Sum of natural numbers class SumOfNaturalNumbers {
Computer Programming Methodology Input and While Loop
Building Java Programs
Repetition.
Something about Java Introduction to Problem Solving and Programming 1.
Decision statements. - They can use logic to arrive at desired results
Functions Used to write code only once Can use parameters.
Computing Adjusted Quiz Total Score
TO COMPLETE THE FOLLOWING:
عرض اجمالي المهام الشرطية في سي شارب (الأمر if)
Java Lesson 36 Mr. Kalmes.
Code Animation Examples
References, Objects, and Parameter Passing
Recursive GCD Demo public class Euclid {
References and Objects
class PrintOnetoTen { public static void main(String args[]) {
Java Programming with Multiple Classes
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
if-else if (condition) { statements1 } else { statements2
Module 4 Loops and Repetition 4/7/2019 CSE 1321 Module 4.
Chapter 13 Exception Handling: A Deeper Look
CSE Module 1 A Programming Primer
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
while while (condition) { statements }
Scope scope: The part of a program where a variable exists. From its declaration to the end of the { } braces A variable declared in a for loop exists.
Recursion Method calling itself (circular definition)
Lecture 22: Number Systems
Methods/Functions.
MIS 222 – Lecture 12 10/9/2003.
Presentation transcript:

using System; namespace Demo01 { class Program static void Main(string[] args) Console.WriteLine("Hello world"); }

using System; namespace Demo01 { class Program static void Main(string[] args) string name = "world"; Console.WriteLine("Hello " + name); }

String Is a type Contains text

using System; namespace Demo01 { class Program static void Main(string[] args) string name = "world"; Console.WriteLine("Hello " + name); name = "Loek"; }

using System; namespace Demo01 { class Program static void Main(string[] args) string name = "world"; Console.WriteLine("Hello " + name); name = "Loek"; name = "Leo"; }

Integer Is a type Contains numbers

using System; namespace Demo01 { class Program static void Main(string[] args) string name = "world"; Console.WriteLine("Hello " + name); name = "Loek"; int year = 2017; Console.WriteLine("Hello " + name + " this year is " + year); }

using System; namespace Demo01 { class Program static void Main(string[] args) string name = "world"; Console.WriteLine("Hello " + name); name = "Loek"; int year = 2017; Console.WriteLine("Hello " + name + " this year is " + year); year = year + 1; }

Loops Made to repeat things

for (int i = 0; i < 10; i++) { Console.WriteLine("Hello " + name + " this year is " + year + i); }

Order is important. Just like in Math: for (int i = 0; i < 10; i++) { Console.WriteLine("Hello " + name + " this year is " + (year + i)); } Order is important. Just like in Math: ^ * / + -