VB.Net Programming Console Application

Slides:



Advertisements
Similar presentations
Lab 8 User Defined Function.
Advertisements

If – Case Programs CSC Arwa © 2008.
Working with the data type: char  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to Computers and Programming.
Basic Input/Output and Variables Ethan Cerami New York
Introduction to Classes and Objects (Through Ch 5) Dr. John P. Abraham Professor UTPA.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
Programming Examples to Accompany Structure Topic Please use speaker notes for additional information!
CH2 – Using Data. Constant Something which cannot be changed Data Type Format and size of a data item Intrinsic Data Types Pg. 47 – Table 2-1 Basic ones.
1.3 Console Input And Output academy.zariba.com 1.
Chapter 2: Using Data.
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Type Conversions Implicit Conversion Explicit Conversion.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Dr. Tami Meredith Saint Mary's & Dalhousie Universities.
Chapter 2 Input, Variables and Data Types. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are.
Pay Example (PFirst98) Please use speaker notes for additional information!
Variables, Input, and Output. Challenge: ● Ask the user his or her name, and repeat that name to the user ● Pause video and try.
Road map char data type Reading –Liang 5: Chapter 2: 2.7.4; 2.9; –Liang 6: Chapter 2: 2.7.4; 2.9 –Liang 7: Chapter 2: 2.7.4; 2.9.
Variables in VB.NET. Variables  A storage location in memory (RAM)  Holds data/information while the program is running  These storage locations can.
C# Programming: Basic Concept Part 2 Computer and Programming (204111)
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
Variables in VB. What is a variable? ► A named memory location that stores a value.
مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Input, Output and Variables GCSE Computer Science – Python.
Program Structure Example for Data Segment CRLF EQU 0DH, 0AH PROMPT DB 'Enter a digit between 0 and 9', 0 VAR1 DB ? ARRAY DW 1234h, 23h, 0FF54h.
Chapter 3 Using Variables, Constants, Formatting Mrs. UlshaferSept
C# Basic Syntax, Visual Studio, Console Input / Output
Egyptian Language School Computer Department
C# Basic Syntax, Visual Studio, Console Input / Output
A variable is a name for a value stored in memory.
Using the Console.
Quiz # 02 Design a data type Date to hold date
Programming Fundamental
Value-Returning Functions
Computing Fundamentals
VB.Net Programming Console Application
Basic operations in Matlab
Input/Output Input/Output operations are performed using input/output functions Common input/output functions are provided as part of C’s standard input/output.
Chapter 2.
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
Microsoft Visual Basic 2005 BASICS
Use proper case (ie Caps for the beginnings of words)
INPUT & OUTPUT scanf & printf.
Introduction to C++ Programming
Variables, Loops, Decision Statements, etc
We are starting to program with JavaScript
Strings A collection of characters taken as a set:
VB.Net Programming Console Application
Variables and Expressions
Chapter 3 – Introduction to C# Programming
Text / Serial / Sequential Files
Exercise Solution First questions What's output What's input
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
C# Programming: From Problem Analysis to Program Design
Introduction to Programming
7 – Variables, Input and Output
BO65: PROGRAMMING WRITING TO TEXT FILES.
VB.Net Programming Console Application
Variables Here we go.
Chapter 2: Input, Processing, and Output
Data Types and Maths Programming Guides.
CS 1111 Introduction to Programming Spring 2019
Array Fundamentals A simple example program will serve to introduce arrays. This program, REPLAY, creates an array of four integers representing the ages.
Programming Fundamental-1
Python Creating a calculator.
Presentation transcript:

VB.Net Programming Console Application Walkthrough Example : Input Output

Narrative Memory Screen Code The first line of the program indicates the main( ) procedure. Screen Code Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub

Narrative Memory Screen Code Name Age Gender Balance Interest These lines create named memory locations to store the data entered by the program user. Name is string to store characters Age is integer to store whole numbers Gender is char to store a single character Balance & Interest are decimal to store numbers with digits after the point. Name Age Gender Balance Interest Screen Code Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub

Narrative Memory Screen Code Enter Name…….: Name Age Balance Interest This line writes to the console screen. The words in quotes appear on the screen. Write will display the contents of the quotes and stay on the same line. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….: Name Age Balance Interest Gender

Narrative Memory Screen Code Name Age Gender Balance Interest Jim This next line reads the line typed by the program user and stores it in the named memory location Name. Name Age Gender Balance Interest Jim Screen Code Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Enter Name…….:Jim

Narrative Memory Screen Code This line writes to the console screen. The words in quotes appear on the screen. Name Age Gender Balance Interest Jim Screen Code Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Enter Name…….:Jim Enter Age………:

Narrative Memory Screen Code This next line reads the line typed by the program user and stores it in the named memory location Age. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….:Jim Enter Age………:23 Name Age Balance Interest Jim 23 Gender

Narrative Memory Screen Code This line writes to the console screen. The words in quotes appear on the screen. Name Age Gender Balance Interest Jim 23 Screen Code Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Enter Name…….:Jim Enter Age………:23 Gender.…………:

Narrative Memory Screen Code This next line reads the line typed by the program user and stores it in the named memory location Gender. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….:Jim Enter Age………:23 Gender.…………:M Name Age Balance Interest Jim 23 Gender M

Narrative Memory Screen Code This line writes to the console screen. The words in quotes appear on the screen. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….:Jim Enter Age………:23 Gender.…………:M Enter Balance…..: Name Age Balance Interest Jim 23 Gender M

Narrative Memory Screen Code This next line reads the line typed by the program user and stores it in the named memory location Balance. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age.........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….:Jim Enter Age………:23 Gender.…………:M Enter Balance…..:100 Name Age Balance Interest Jim 23 100.00 Gender M

Narrative Memory Screen Code This next line uses the contents of Balance to calculate 10% of its value and places the answer into the location Interest. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age...........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….:Jim Enter Age………:23 Gender.…………:M Enter Balance…..:100 Name Age Balance Interest Jim 23 100.00 10.00 Gender M

Narrative Memory Screen Code These next lines Write the contents of the variables to the console screen. Note the use of {0} which represents the position of the named variable between the quotes. Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age...........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Code Narrative Memory Screen Enter Name…….:Jim Enter Age………:23 Enter Gender. .…:M Enter Balance…..:100 ------------------------------- Name…………:Jim Age……………:23 Gender………..:M Balance………..:100 10% Interest is..:10.00 Name Age Balance Interest Jim 23 100.00 10.00 Gender M

Narrative Memory Screen Code This final line holds the display until the program user presses a key. And this program ends. Name Age Gender Balance Interest Jim 23 M 100.00 10.00 Screen Code Sub Main() Dim Name As String Dim Age As Integer Dim Gender As Char Dim Balance As Decimal Dim Interest As Decimal 'input data Console.Write("Enter Name :") Name = Console.ReadLine() Console.Write("Enter Age :") Age = Console.ReadLine() Console.Write("Enter Gender :") Gender = Console.ReadLine() Console.Write("Enter Balance :") Balance = Console.ReadLine() 'Process Interest = Balance * 10 / 100 'Output Console.WriteLine("-----------------") Console.WriteLine("Name........:{0}", Name) Console.WriteLine("Age...........:{0}", Age) Console.WriteLine("Gender......:{0}", Gender) Console.WriteLine("Balance.....:{0}", Balance) Console.WriteLine("10% Interest is :{0:f2}", Interest) Console.ReadKey() End Sub Enter Name…….:Jim Enter Age………:23 Enter Gender. .…:M Enter Balance…..:100 ------------------------------- Name…………:Jim Age……………:23 Gender………..:M Balance………..:100 10% Interest is..:10.00