CSE Module 1 A Programming Primer

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 Methodology (1). Implementing Methods main.
Class Scope class Student { private: string id; string firstName, lastName; float gpa; public: void Read() { cin >> id >> firstName >> lastName >> gpa;
Computer and Programming
If – Case Programs CSC Arwa © 2008.
פתרון בוחן הכיתה. שאלה #1 Module Module1 Sub Main() Dim x, z As Integer x = Console.ReadLine() z = Console.ReadLine() If (x = 0) Then Console.WriteLine("Error")
Introduction to Classes and Objects (Through Ch 5) Dr. John P. Abraham Professor UTPA.
Reading and Writing to the Console Svetlin Nakov Telerik Corporation
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
INPUT/OUTPUT STATEMENT ADDITION SLIDES. Console.ReadLine() – Use to get the input (String) from user Convert string to other data type – int.Parse() 
Computer Programming 1.  Editor Console Application Notepad Notepad++ Edit plus etc.  Compiler & Interpreter Microsoft.NET Framework  Microsoft visual.
Console Input. So far… All the inputs for our programs have been hard-coded in the main method or inputted using the dialog boxes of BlueJ It’s time to.
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
Iteration (Loop) partI Thanachat Thanomkulabut. Consider the following program! using System; Namespace SimPleExample { class SimPleC { class SimPleC.
Reading and Writing to the Console Svetlin Nakov Telerik Corporation
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
Introduction to Computing Concepts Note Set 15. JOptionPane.showMessageDialog Message Dialog Allows you to give a brief message to the user Can be used.
Formatted Output (printf) CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Console Input / Output Reading and Writing to the Console SoftUni Team Technical Trainers Software University
 A class is a collection of things which posses common similarities.  In C#.NET a class is a user defined Data type and is Known as Reference.
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
INPUT/OUTPUT STATEMENT ADDITION SLIDES. Console.ReadLine() – Use to get the input (String) from user Convert string to other data type – int.Parse() 
 2002 Prentice Hall. All rights reserved. 1 Chapter 4 – Control Structures Part 1 Outline Counter-Controlled Repetition: Example Sentinel-Controlled Repetition:
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
Lecture 2 Review of 1301 and C# Richard Gesick. Common data types int, long, double, float, char, bool, string.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Test1 Here some text. Text 2 More text.
C# Basic Syntax, Visual Studio, Console Input / Output
C# Basic Syntax, Visual Studio, Console Input / Output
C# — Console Application
TemperatureConversion
A Java Program: // Fig. 2.1: Welcome1.java // Text-printing program.
using System; namespace Demo01 { class Program
COMP 170 – Introduction to Object Oriented Programming
Functions Used to write code only once Can use parameters.
Lecture 11 C Parameters Richard Gesick.
Advanced Programming Lecture 02: Introduction to C# Apps
Variables, Loops, Decision Statements, etc
Exception Handling CSCI293 - C# October 3, 2005.
[type text here] [type text here] [type text here] [type text here]
Your text here Your text here Your text here Your text here Your text here Pooky.Pandas.
Your text here Your text here Your text here Your text here
class PrintOnetoTen { public static void main(String args[]) {
[type text here] [type text here] [type text here] [type text here]
1D Arrays and Lots of Brackets
Module 4 Loops and Repetition 4/7/2019 CSE 1321 Module 4.
Lecture 1 Review of 1301/1321 CSE /26/2018.
Module 3 Selection Structures 4/3/2019 CSE 1321 Module 3.
Methods and Data Passing
Scope of variables class scopeofvars {
Methods and Data Passing
CSE Module 1 A Programming Primer
Module 3 Selection Structures 4/5/2019 CSE 1321 Module 3.
CSE Module 1 A Programming Primer
Object-Oriented Programming and class Design
Var Name =Console . ReadLine();
Module 4 Loops and Repetition 4/15/2019 CSE 1321 Module 4.
CS1S467 GUI Programming LECTURE 14 Methods (1 of 2)
Object-Oriented Programming and class Design
Ps Module 7 – Part II 2D Arrays and LISTS 5/26/2019 CSE 1321 Module 7.
CSE Module 1 A Programming Primer
CSE 1321 Modules 1-5 Review Spring 2019
More on iterations using
Lecture 1 Review of 1301/1321 CSE /26/2018.
Computer Science Club 1st November 2019.
CSE Module 1 A Programming Primer
Chapter 3 String manipulation.
Object-Oriented Programming and class Design
Presentation transcript:

CSE 1321 - Module 1 A Programming Primer 4/5/2019 CSE 1321 Module 1

Ps Skeletons BEGIN MAIN END MAIN Note: every time you BEGIN something, you must END it! Write them as pairs! 4/5/2019 CSE 1321 Module 1

Skeletons using System; class MainClass { public static void Main (string[] args) { } Point out the beginning and end Note: The opening “{“ means BEGIN and the closing “}” means END 4/5/2019 CSE 1321 Module 1

Ps Printing BEGIN MAIN​ PRINT “Hello, World!”​ PRINT “Bob” + “ was” + “ here”​ END MAIN Point out the beginning and end Ps 4/5/2019 CSE 1321 Module 1

Printing using System; class MainClass { public static void Main (string[] args) { Console.WriteLine ("Hello, World!"); Console.WriteLine ("Bob"+" was"+" here"); } Note: There’s also a Console.Write() 4/5/2019 CSE 1321 Module 1

Declaring/Assigning Variables BEGIN MAIN CREATE userName CREATE studentGPA userName ← “Bob” studentGPA ← 1.2 END MAIN userName “Bob” studentGPA 1.2 Ps 4/5/2019 CSE 1321 Module 1

Declaring/Assigning Variables using System; class MainClass { public static void Main (string[] args) { string userName; float gpa; userName = "Bob"; gpa = 1.2f; } 4/5/2019 CSE 1321 Module 1

Reading Text from the User BEGIN MAIN CREATE userInput PRINT “Please enter your name” READ userInput PRINT “Hello, ” + userInput END MAIN Ps 4/5/2019 CSE 1321 Module 1

Reading Text from the User using System; class MainClass { public static void Main (string[] args) { string userInput; Console.Write("Please enter your name: "); userInput = Console.ReadLine(); Console.WriteLine("Hello, "+userInput); } 4/5/2019 CSE 1321 Module 1

Reading Numbers from the User BEGIN MAIN CREATE userInput PRINT “Please enter your age: ” READ userInput PRINT “You are ” + userInput + “ years old.” END MAIN Ps 4/5/2019 CSE 1321 Module 1

Reading Numbers from the User using System; class MainClass { public static void Main (string[] args) { string userInput; Console.Write("Please enter your age: "); userInput = Console.ReadLine(); int age = Convert.ToInt32(userInput); Console.WriteLine("You are "+age+" years old."); } 4/5/2019 CSE 1321 Module 1