This chapter introduces Visual Basic programming and presents simple programs to illustrate key concepts. It discusses printing text, getting user input, performing arithmetic operations, using variables to store and manipulate data, and making decisions using equality and relational operators. The chapter contains code examples with explanations and step-by-step instructions for creating and running programs in the Visual Studio IDE.
It is a very simple and easy language, C language is mainly used for develop desktop based application. All other programming languages were derived directly or indirectly from C programming concepts. This language have following features;
http://www.tutorial4us.com/cprogramming/c-features
It is a very simple and easy language, C language is mainly used for develop desktop based application. All other programming languages were derived directly or indirectly from C programming concepts. This language have following features;
http://www.tutorial4us.com/cprogramming/c-features
PT1420: File Access and Visual Basic
Page 1
This lab examines how to work with a file by writing Visual Basic code. Read the following
programming problem prior to completing the lab.
Write and design a simple program that will take 3 pieces of data and write it to a file. Create
variables and set them equal to the appropriate values:
Declare string firstName = “xxx”
Declare string lastName = “xxx”
Declare integer age = your age
Write this information to a file called myRecords.txt. Next, read this information from
the file and print it to the screen.
Step 1: Create a new Visual Basic workspace and add the following code:
Module Module1
Sub Main()
Dim firstName As String = "XXXX"
Dim lastName As String = "XXX"
Dim age As Integer = ####
Dim writer As System.IO.StreamWriter = System.IO.File.CreateText("myRecords.txt")
writer.WriteLine(firstName & " " & lastName & " " & age)
writer.Close()
Dim reader As System.IO.StreamReader = System.IO.File.OpenText("myRecords.txt")
Dim myInfo As String = reader.ReadLine()
Console.WriteLine(myInfo)
PT1420: File Access and Visual Basic
Page 2
reader.Close()
'this causes a pause so you can see your program
Console.Write("Press enter to continue...")
Console.ReadLine()
End Sub
End Module
Your module looks like this:
PT1420: File Access and Visual Basic
Page 3
Step 2: Change the values of the variables to your records. Your module looks like this:
Step 3: Run your program so that it works properly. Your output might look as follows:
PT1420: File Access and Visual Basic
Page 4
Step 4: Locate the .txt file in the bin\debug folder, and view your .txt file. Your output might
look as follows:
PT1420: File Access and Visual Basic
Page 5
Step 5: Submit the Visual Basic code as a compressed (zipped) folder using the following steps:
a. Open Windows Explorer --> Start --> All Programs --> Accessories --> Windows Explorer.
Your Windows Explorer might look as follows:
...
The key differences between the MDR and IVDR in the EUAllensmith572606
In the European Union (EU), two significant regulations have been introduced to enhance the safety and effectiveness of medical devices – the In Vitro Diagnostic Regulation (IVDR) and the Medical Device Regulation (MDR).
https://mavenprofserv.com/comparison-and-highlighting-of-the-key-differences-between-the-mdr-and-ivdr-in-the-eu/
Business Valuation Principles for EntrepreneursBen Wann
This insightful presentation is designed to equip entrepreneurs with the essential knowledge and tools needed to accurately value their businesses. Understanding business valuation is crucial for making informed decisions, whether you're seeking investment, planning to sell, or simply want to gauge your company's worth.
[Note: This is a partial preview. To download this presentation, visit:
https://www.oeconsulting.com.sg/training-presentations]
Sustainability has become an increasingly critical topic as the world recognizes the need to protect our planet and its resources for future generations. Sustainability means meeting our current needs without compromising the ability of future generations to meet theirs. It involves long-term planning and consideration of the consequences of our actions. The goal is to create strategies that ensure the long-term viability of People, Planet, and Profit.
Leading companies such as Nike, Toyota, and Siemens are prioritizing sustainable innovation in their business models, setting an example for others to follow. In this Sustainability training presentation, you will learn key concepts, principles, and practices of sustainability applicable across industries. This training aims to create awareness and educate employees, senior executives, consultants, and other key stakeholders, including investors, policymakers, and supply chain partners, on the importance and implementation of sustainability.
LEARNING OBJECTIVES
1. Develop a comprehensive understanding of the fundamental principles and concepts that form the foundation of sustainability within corporate environments.
2. Explore the sustainability implementation model, focusing on effective measures and reporting strategies to track and communicate sustainability efforts.
3. Identify and define best practices and critical success factors essential for achieving sustainability goals within organizations.
CONTENTS
1. Introduction and Key Concepts of Sustainability
2. Principles and Practices of Sustainability
3. Measures and Reporting in Sustainability
4. Sustainability Implementation & Best Practices
To download the complete presentation, visit: https://www.oeconsulting.com.sg/training-presentations
Digital Transformation and IT Strategy Toolkit and TemplatesAurelien Domont, MBA
This Digital Transformation and IT Strategy Toolkit was created by ex-McKinsey, Deloitte and BCG Management Consultants, after more than 5,000 hours of work. It is considered the world's best & most comprehensive Digital Transformation and IT Strategy Toolkit. It includes all the Frameworks, Best Practices & Templates required to successfully undertake the Digital Transformation of your organization and define a robust IT Strategy.
Editable Toolkit to help you reuse our content: 700 Powerpoint slides | 35 Excel sheets | 84 minutes of Video training
This PowerPoint presentation is only a small preview of our Toolkits. For more details, visit www.domontconsulting.com
Enterprise Excellence is Inclusive Excellence.pdfKaiNexus
Enterprise excellence and inclusive excellence are closely linked, and real-world challenges have shown that both are essential to the success of any organization. To achieve enterprise excellence, organizations must focus on improving their operations and processes while creating an inclusive environment that engages everyone. In this interactive session, the facilitator will highlight commonly established business practices and how they limit our ability to engage everyone every day. More importantly, though, participants will likely gain increased awareness of what we can do differently to maximize enterprise excellence through deliberate inclusion.
What is Enterprise Excellence?
Enterprise Excellence is a holistic approach that's aimed at achieving world-class performance across all aspects of the organization.
What might I learn?
A way to engage all in creating Inclusive Excellence. Lessons from the US military and their parallels to the story of Harry Potter. How belt systems and CI teams can destroy inclusive practices. How leadership language invites people to the party. There are three things leaders can do to engage everyone every day: maximizing psychological safety to create environments where folks learn, contribute, and challenge the status quo.
Who might benefit? Anyone and everyone leading folks from the shop floor to top floor.
Dr. William Harvey is a seasoned Operations Leader with extensive experience in chemical processing, manufacturing, and operations management. At Michelman, he currently oversees multiple sites, leading teams in strategic planning and coaching/practicing continuous improvement. William is set to start his eighth year of teaching at the University of Cincinnati where he teaches marketing, finance, and management. William holds various certifications in change management, quality, leadership, operational excellence, team building, and DiSC, among others.
RMD24 | Debunking the non-endemic revenue myth Marvin Vacquier Droop | First ...BBPMedia1
Marvin neemt je in deze presentatie mee in de voordelen van non-endemic advertising op retail media netwerken. Hij brengt ook de uitdagingen in beeld die de markt op dit moment heeft op het gebied van retail media voor niet-leveranciers.
Retail media wordt gezien als het nieuwe advertising-medium en ook mediabureaus richten massaal retail media-afdelingen op. Merken die niet in de betreffende winkel liggen staan ook nog niet in de rij om op de retail media netwerken te adverteren. Marvin belicht de uitdagingen die er zijn om echt aansluiting te vinden op die markt van non-endemic advertising.
B2B payments are rapidly changing. Find out the 5 key questions you need to be asking yourself to be sure you are mastering B2B payments today. Learn more at www.BlueSnap.com.
Personal Brand Statement:
As an Army veteran dedicated to lifelong learning, I bring a disciplined, strategic mindset to my pursuits. I am constantly expanding my knowledge to innovate and lead effectively. My journey is driven by a commitment to excellence, and to make a meaningful impact in the world.
Affordable Stationery Printing Services in Jaipur | Navpack n PrintNavpack & Print
Looking for professional printing services in Jaipur? Navpack n Print offers high-quality and affordable stationery printing for all your business needs. Stand out with custom stationery designs and fast turnaround times. Contact us today for a quote!
Implicitly or explicitly all competing businesses employ a strategy to select a mix
of marketing resources. Formulating such competitive strategies fundamentally
involves recognizing relationships between elements of the marketing mix (e.g.,
price and product quality), as well as assessing competitive and market conditions
(i.e., industry structure in the language of economics).
Recruiting in the Digital Age: A Social Media MasterclassLuanWise
In this masterclass, presented at the Global HR Summit on 5th June 2024, Luan Wise explored the essential features of social media platforms that support talent acquisition, including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok.
1. Chapter 3 – Introduction to Visual Basic Programming Outline 3.1 Introduction 3.2 Simple Program: Printing a Line of Text 3.3 Another Simple Program: Adding Integers 3.4 Memory Concepts 3.5 Arithmetic 3.6 Decision Making: Equality and Relational Operators 3.7 Using a Dialog to Display a Message
2.
3.
4.
5.
6.
7. 3.2 Simple Program: Printing a Line of Text Fig. 3.2 Creating a Console Application with the New Project dialog. Left pane Right pane Project name File location
8. 3.2 Simple Program: Printing a Line of Text Fig. 3.3 IDE with an open console application. Editor window (containing program code)
9. 3.2 Simple Program: Printing a Line of Text Fig. 3.4 Renaming the program file in the Properties window. Solution Explorer File Name property Click Module1.vb to display its properties Properties window
10.
11.
12. 3.2 Simple Program: Printing a Line of Text Fig. 3.5 IntelliSense feature of the Visual Studio .NET IDE. Partially-typed member Member list Description of highlighted member
13. 3.2 Simple Program: Printing a Line of Text Fig. 3.6 Parameter Info and Parameter List windows. Up arrow Down arrow Parameter List window Parameter Info window
14. 3.2 Simple Program: Printing a Line of Text Fig. 3.7 Executing the program shown in Fig. 3.1. Command window prompts the user to press a key after the program terminates
15. 3.2 Simple Program: Printing a Line of Text Fig. 3.8 IDE indicating a syntax error. Omitted parenthesis character (syntax error) Blue underline indicates a syntax error Task List window Error description(s)
16. Welcome2.vb Program Output 1 ' Fig. 3.9: Welcome2.vb 2 ' Writing line of text with multiple statements. 3 4 Module modSecondWelcome 5 6 Sub Main() 7 Console.Write( "Welcome to " ) 8 Console.WriteLine( "Visual Basic!" ) 9 End Sub ' Main 11 12 End Module ' modSecondWelcome Welcome to Visual Basic! Method Write does not position the output cursor at the beginning of the next line Method WriteLine positions the output cursor at the beginning of the next line
17.
18. Addition.vb 1 ' Fig. 3.10: Addition.vb 2 ' Addition program. 3 4 Module modAddition 5 6 Sub Main() 7 8 ' variables for storing user input 9 Dim firstNumber, secondNumber As String 10 11 ' variables used in addition calculation 12 Dim number1, number2, sumOfNumbers As Integer 13 14 ' read first number from user 15 Console.Write( "Please enter the first integer: " ) 16 firstNumber = Console.ReadLine() 17 18 ' read second number from user 19 Console.Write( "Please enter the second integer: " ) 20 secondNumber = Console.ReadLine() 21 22 ' convert input values to Integers 23 number1 = firstNumber 24 number2 = secondNumber 25 26 sumOfNumbers = number1 + number2 ' add numbers 27 28 ' display results 29 Console.WriteLine( "The sum is {0}" , sumOfNumbers) 30 31 End Sub ' Main 32 33 End Module ' modAddition Declarations begin with keyword Dim These variables store strings of characters These variables store integers values First value entered by user is assigned to variable firstNumber Method ReadLine causes program to pause and wait for user input Implicit conversion from String to Integer Sums integers and assigns result to variable sumOfNumbers Format indicates that the argument after the string will be evaluated and incorporated into the string
19. Addition.vb Please enter the first integer: 45 Please enter the second integer: 72 The sum is 117
20. 3.3 Another Simple Program: Adding Integers Fig. 3.11 Dialog displaying a run-time error. If the user types a non-integer value, such as “ hello ,” a run-time error occurs
21.
22. 3.4 Memory Concepts Fig. 3.12 Memory location showing name and value of variable number1 . Fig. 3.13 Memory locations after values for variables number1 and number2 have been input. 45 number1 45 45 number1 number2
23.
24. 3.5 Arithmetic Fig. 3.14 Memory locations after an addition operation. 45 45 number1 number2 sumOfNumbers 45
29. 3.5 Arithmetic Fig. 3.16 Order in which a second-degree polynomial is evaluated. Step 1. Step 2. Step 5. Step 3. Step 4. Step 6. y = 2 * 5 * 5 + 3 * 5 + 7 2 * 5 is 10 (Leftmost multiplication) y = 10 * 5 + 3 * 5 + 7 10 * 5 is 50 (Leftmost multiplication) y = 50 + 3 * 5 + 7 3 * 5 is 15 (Multiplication before addition) y = 50 + 15 + 7 50 + 15 is 65 (Leftmost addition) y = 65 + 7 65 + 7 is 72 (Last addition) y = 72 (Last operation—place 72 into y )
30.
31. 3.6 Decision Making: Equality and Relational Operators Fig. 3.17 Equality and relational operators.
32. Comparison.vb 1 ' Fig. 3.19: Comparison.vb 2 ' Using equality and relational operators. 3 4 Module modComparison 5 6 Sub Main() 7 8 ' declare Integer variables for user input 9 Dim number1, number2 As Integer 10 11 ' read first number from user 12 Console.Write( "Please enter first integer: " ) 13 number1 = Console.ReadLine() 14 15 ' read second number from user 16 Console.Write( "Please enter second integer: " ) 17 number2 = Console.ReadLine() 18 19 If (number1 = number2) Then 20 Console.WriteLine( "{0} = {1}", number1, number2) 21 End If 22 23 If (number1 <> number2) Then 24 Console.WriteLine( "{0} <> {1}", number1, number2) 25 End If 26 27 If (number1 < number2) Then 28 Console.WriteLine( "{0} < {1}", number1, number2) 29 End If 30 31 If (number1 > number2) Then 32 Console.WriteLine( "{0} > {1}", number1, number2) 33 End If Variables of the same type may be declared in one declaration The If/Then structure compares the values of number1 and number2 for equality
33. Comparison.vb Program Output 34 35 If (number1 <= number2) Then 36 Console.WriteLine( "{0} <= {1}", number1, number2) 37 End If 38 39 If (number1 >= number2) Then 40 Console.WriteLine( "{0} >= {1}", number1, number2) 41 End If 42 43 End Sub ' Main 44 45 End Module ' modComparison Please enter first integer: 1000 Please enter second integer: 2000 1000 <> 2000 1000 < 2000 1000 <= 2000 Please enter first integer: 515 Please enter second integer: 49 515 <> 49 515 > 49 515 >= 49 Please enter first integer: 333 Please enter second integer: 333 333 = 333 333 <= 333 333 >= 333
34. 3.6 Decision Making: Equality and Relational Operators Fig. 3.19 Precedence and associativity of operators introduced in this chapter.
35.
36. SquareRoot.vb Program Output 1 ' Fig. 3.20: SquareRoot.vb 2 ' Displaying square root of 2 in dialog. 3 4 Imports System.Windows.Forms ' Namespace containing MessageBox 5 6 Module modSquareRoot 7 8 Sub Main() 9 10 ' Calculate square root of 2 11 Dim root As Double = Math.Sqrt( 2 ) 12 13 ' Display results in dialog 14 MessageBox.Show( "The square root of 2 is " & root, _ 15 "The Square Root of 2" ) 16 End Sub ' Main 17 18 End Module ' modThirdWelcome Empty command window Sqrt method of the Math class is called to compute the square root of 2 The Double data type stores floating-point numbers Method Show of class MessageBox Line-continuation character
37. 3.7 Using a Dialog to Display a Message Fig. 3.21 Dialog displayed by calling MessageBox.Show. Title bar Close box Mouse pointer Dialog sized to accommodate contents. OK button allows the user to dismiss the dialog.
38.
39. 3.7 Using a Dialog to Display a Message Fig. 3.22 Obtaining documentation for a class by using the Index dialog. Search string Filter Link to MessageBox documentation
40. 3.7 Using a Dialog to Display a Message Fig. 3.23 Documentation for the MessageBox class. Requirements section heading MessageBox class documentation Assembly containing class MessageBox
41.
42. 3.7 Using a Dialog to Display a Message Fig. 3.24 Adding a reference to an assembly in the Visual Studio .NET IDE. References folder (expanded) Solution Explorer before reference is added Solution Explorer after reference is added System.Windows.Forms reference
43. 3.7 Using a Dialog to Display a Message Fig. 3.25 Internet Explorer window with GUI components. Label Button (displaying an icon) Menu (e.g., Help ) Text box Menu bar