Pseudo-code. Pseudo-code Task 1 Preparation Use the following code to declare, initialise and populate an array in a new VB.NET console application:

Slides:



Advertisements
Similar presentations
Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
Advertisements

A Level Computing#BristolMet Session Objectives#U2 S2 MUST describe the steps of an algorithm using a program flowchart SHOULD explain the data types and.
Copyright 2010 by Pearson Education Building Java Programs Chapter 7 Lecture 7-2: Arrays as Parameters reading: , 3.3 self-checks: Ch. 7 #5, 8,
Assembly Code Example Selection Sort.
1 Various Methods of Populating Arrays Randomly generated integers.
Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
PSEUDOCODE & FLOW CHART
Session Objectives# 24 COULD code the solution for an algorithm
Need for Arrays Exercise Read the IDs and the grades for all ICS 101 students. Compute and print the average of the students. Print the grades and IDs.
Programming with Collections Collections in Java Using Arrays Week 9.
General Computer Science for Engineers CISC 106 Lecture 20 Dr. John Cavazos Computer and Information Sciences 04/08/2009.
Arrays-Part 1. Objectives Declare and initialize a one-dimensional array Store data in a one-dimensional array Display the contents of a one-dimensional.
Introduction to Arrays Chapter 7 Why use arrays? To store & represent lists of homogeneous values To simplify program code To eliminate the need to reread.
Program Design and Development
Class 0: Review and Perspective. cis 335 Fall 2001 Barry Cohen Class info n Barry Cohen n n Office hours: W 3:15-4:40.
Chapter seven review. What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For.
Sorting and Searching Algorithms Week 11 DSA. Recap etc. Arrays are lists of data 1-D, 2-D etc. Lists associated with searching and sorting Other structures.
Chapter 7: Working with Arrays
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 14P. 1Winter Quarter Pointers Lecture 14.
START DECLARE num AS integer array of size 10 DECLARE count AS integer FOR count ← 1 TO 10 num[count] ← count * 2 ENDFOR STOP Trace table headed as follows:
Java Programming, 3e Concepts and Techniques Chapter 3 Section 62 – Manipulating Data Using Methods – Day 1.
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Mastering STACKS AN INTRODUCTION TO STACKS Data Structures.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
PROGRAMMING Functions. Objectives Understand the importance of modular programming. Know the role of functions within programming. Use functions within.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Main Index Contents 11 Main Index Contents Week 3 – The Vector Container.
Examples using Arrays. Summing Squares Problem: To compute the sum of the squares of N numbers N is given N values are also given These should be read.
By the end of this session you should be able to...
19/10/20151 Data Structures Arrays. 219/10/2015 Learning Objectives Explain initialising arrays and reading data into arrays. Design and write routine/s.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
04/11/ Arrays 1D Arrays Defining, Declaring & Processing.
Fill the screen challenge! This is a starter activity and should take 3 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.In interactive mode,
Sorting: Optimising Bubblesort Damian Gordon. Sorting: Bubble Sort If we look at the bubble sort algorithm again:
Data Structures: Arrays Damian Gordon. Arrays Imagine we had to record the age of everyone in the class, we could do it declaring a variable for each.
AP Computer Science edition Review 1 ArrayListsWhile loopsString MethodsMethodsErrors
Python: Sorting - Bubblesort Damian Gordon. Sorting: Bubblesort The simplest algorithm for sort an array is called BUBBLE SORT. It works as follows for.
Exercise 1: IF/ELSE Step 1: Open NotePad++ and create “number.php” in your webspace Step 2: Write codes to do the following 1.Generate a random number.
Data Structures & Algorithms CHAPTER 1 Introduction Ms. Manal Al-Asmari.
ME 142 Engineering Computation I Using Excel Arrays in Functions.
Bubble Sort Notes David Beard CIS220. Bubble Sort for Strings Double pass algorithm to sort a single dimensional array. Inner loop “bubbles” largest element.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
An array example: the transpose A 2-D array corresponds to a mathematical matrix: One simple matrix operation transposes the matrix.
National Diploma Unit 4 Introduction to Software Development Data Structures – Loops and selection.
Shellsort improved insertion sort. Shellsort  insertion sort: -most moves of data are a single step  shellsort: -long moves in first loop, then shorter.
CSC 142 Q 1 CSC 142 Sorting [Reading: chapter 11].
Bubble sort. Quite slow, but simple Principles: Compare 2 numbers next to each other (lets call it current and the one next to it) If the current number.
Low-Level Programming Languages, Pseudocode and Testing Chapter 6.
26/06/ Iteration Loops For … To … Next. 226/06/2016 Learning Objectives Define a program loop. State when a loop will end. State when the For.
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
CSE 220 – C Programming Pointers.
ALGORITHMS AND FLOWCHARTS
Computer Science 210 Computer Organization
Main Points: - More Fundamental Algorithms on Arrays.
Computer Science 210 Computer Organization
Sorting Given a[0], a[1], ..., a[n-1] reorder entries so that
Pseudocode algorithms using sequence, selection and repetition
ARRAYS 1 GCSE COMPUTER SCIENCE.
Problem Solving and Algorithm Design
3.1 Iteration Loops For … To … Next 18/01/2019.
Lesson Objectives Aims Key Words
Bubble sort.
To understand what arrays are and how to use them
Hint idea 2 Split into shorter tasks like this.
CSE 1321 Modules 6-8 Review Spring 2019
Presentation transcript:

Pseudo-code

Pseudo-code Task 1 Preparation Use the following code to declare, initialise and populate an array in a new VB.NET console application: Dim demoArray(9) As Integer For i As Integer = 0 To demoArray.Length - 1 demoArray(i) = Rnd() * 100 Next Add the following code to output the array’s contents in the order that they are stored in: For i As Integer = 0 To demoArray.Length - 1 Console.WriteLine(demoArray(i)) Next You will now write some code to sort the numbers in the array in to order! Don’t panic! You’ll have the pseudo-code!

Pseudo-code Task 1 Add the code to sort the array in-between the two For loops. The pseudo-code is on the next page. Dim demoArray(9) As Integer For i As Integer = 0 To demoArray.Length - 1 demoArray(i) = Rnd() * 100 Next ADD YOUR SORTING ROUTINE AT THIS POINT IN THE CODE For i As Integer = 0 To demoArray.Length - 1 Console.WriteLine(demoArray(i)) Next

Pseudo-code – Bubble Sort Hint: All the variables used are integers. N ← Len(A) For I ← 1 to N - 1 For J ← 1 to N - 1 If (A(J) > A(J + 1) Then Temp ← A(J) A(J) ← A(J + 1) A(J + 1) ← Temp End-If End-For

Pseudo-code Task 2 For this task you need to work as a group. Choose one of the programming tasks you have not completed yet and write a solution to it in pseudo-code. Give your pseudo-code solution to someone else in the group to write in VB.NET. In return, you need to take a pseudo-code solution from someone else and create it in VB.NET. You should find it much easier and quicker to code a solution when the programming logic is mapped out for you!