Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
P1PMF Split1 QBASIC. P1PMF Split2QBasic Command Prompt Will launch the emulator DOS operating system? Press Alt + Enter to display the widescreen.
Advertisements

ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
Introduction to JavaScript Please see speaker notes for additional information!
True BASIC Ch. 6 Practice Questions. What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END.
Computing Theory: BBC Basic Coding Year 11. Lesson Objective You will: Be able to define what BBC basic is Be able to annotate BBC basic code Be able.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
Modifications to program Addda.cbl Please use speaker notes for additional information!
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Array - adding to array at run time Please see speaker notes for additional information!
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Variety of JavaScript Examples Please use speaker notes for additional information!
read and learn from example loop programs develop modular program
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Introduction to BASIC Programming Ken R. Hall, Ph.D. Ken R. Hall Consultants Portland, Oregon.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
1 Project 7: Looping. Project 7 For this project you will produce two Java programs. The requirements for each program will be described separately on.
Answer questions about assignment.. Starting JavaScript, at my site these examples are under programs and JavaScript. You can see the address for this.
Introduction to Programming Python Lab 8: Loops 26 February PythonLab8 lecture slides.ppt Ping Brennan
This is a while loop. The code is done while the condition is true. The code that is done is enclosed in { }. Note that this program has three parts: Housekeeping.
Sophomore Scholars Java
Development Environment
More about comments Review Single Line Comments The # sign is for comments. A comment is a line of text that Python won’t try to run as code. Its just.
CSC111 Quick Revision.
Introduction to Programming
User-Written Functions
Loops BIS1523 – Lecture 10.
Chapter 4 MATLAB Programming
Introduction to Programming
Variables, Expressions, and IO
Chapter 5: Control Structure
Functions CIS 40 – Introduction to Programming in Python
Please use speaker notes for additional information!
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 4 LOOPS © Bobby Hoggard, Department of Computer Science, East Carolina University / These slides may not be used or duplicated without permission.
Pseudocode An Introduction
Conditions and Ifs BIS1523 – Lecture 8.
Use proper case (ie Caps for the beginnings of words)
Introduction to pseudocode
Number and String Operations
More Loops.
More Loops.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
An Introduction to Python
Chapter 1 Minitab Recipe Card
We are starting to program with JavaScript
Java Programming Loops
text box. I brought this up by double clicking on the command button.
Iteration: Beyond the Basic PERFORM
Iteration: Beyond the Basic PERFORM
Introduction to TouchDevelop
Learning about Conditional Selection
Alorithms4 Bank Owner.
Introduction to Programming
We are starting JavaScript. Here are a set of examples
Environment/Report Tutorial
If statements (Inven1, Inven2, Inven2a, Inven3, Inven3a)
Using screens and adding two numbers - addda.cbl
Notes on SQL This slide show will introduce SQL using Access. It assumes only an introductory level of knowledge about Access.
Java Programming Loops
Unit 3: Variables in Java
More on If statements (Calculate, Calculate1, Calculate2)
Introduction to Programming
Incremental Programming
Pseudocode For Program Design.
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
Wrapup which is the document write that says the end.
Presentation transcript:

Please use speaker notes for additional information! Using BBC Basic Please use speaker notes for additional information! Available at: http://www.cix.co.uk/~rrussell/products/bbcwin/download.html This is available for download at: http://www.cix.co.uk/~rrussell/products/bbcwin/download.html.

When I click on Run and then Run from the menu that appears, the following results are shown. This is a more traditional version of basic. Here I am declaring a variable of num1 with a value of 5 and a variable num2 with a value of 7. Then I am adding them up and putting the result in ans. Finally, I am printing ans to the screen. Note that the Basic Command PRINT is in upper case.

This takes in payhr and hrswk using the INPUT command This takes in payhr and hrswk using the INPUT command. The command is in upper case, then the prompt is shown and then the place to store the users response (either payhr or hrswk). Next I calcualte grosspay and then print out the message followed by the results of the calculation. The comma between the two fields in the output results in the space between My pay is and 400.

I changed the comma to a semi-colon between the literal My pay is and grosspay. This eliminated the large number of spaces between them. Essentially the comma makes columns and the semi-colon puts the things together.

This shows an IF statement This shows an IF statement. After calculating the grosspay, I ask if it is less then 1000. If it is, I print the literal I need a raise! Note the syntax of the IF including the ENDIF. Since the gross pay was 800 and 9=800 is less then 1000, the PRINT was executed.

In this example the grosspay was not less then 1000 so the PRINT was not executed.

In this example, I am testing grosspay to see if it is less then 1000 and either way, I am printing a literal. In this case the grosspay is not less then 1000 so the else is executed and the literal Gross pay is okay!

This shows the literal that is printed when the grosspay is less then 1000.

This is a FOR loop. I am starting the variable i at 1 and I am going to stop when the variable i = 5. The command is: FOR i = 1 TO 5 Inside the loop, I added i to i and then printed the i followed by a semi-colon and then the literal + with a space before and after it. Then I put in the semi-colon to separate followed by another i and a semi-colon. Then I put in the = with quotes on either side followed by a semi-colon. Finally I put in the ans that I calculated. You can see the results.

In this example, I am using a loop In this example, I am using a loop. I input the number of times I want to do the loop and store that in the variable num. Then I input the amount I want to deposit to the account each time. Next, I set a ct equal to 1 to count the number of times I do the loop. Next comes the loop. It uses REPEAT as the command and the bottom line in the loop is the UNTIL that tells how many times to do the loop. Inside the loop, I print out amt and the current value of ct along with two literals. Notice that each thing I print is separated with a semi-colon. Then I add the amount to totamt and add 1 to ct. Note that since I did not initialize totamt it starts at 0. When the loop is complete, I print out the literal saying the total is followed by totamt.