TrueBASIC Ch 2 & 3 Sample Problems. What are the errors? (2 total) PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50.

Slides:



Advertisements
Similar presentations
What type of data can a variable hold?
Advertisements

Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 2 Simple C Programs.
This is Java Jeopardy.
Chapter 3 – Fundamental Statements
VARIABLES AND DEBUGGING Beginning Programming. Assignment Statements  Used to hold values in a variable  Calculates a result and stores it in a variable.
Computer Programming w/ Eng. Applications
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
True BASIC Ch. 9 Practice Questions. What are the 4 errors? DIM arr(4) FOR X = 1 TO 4 READ arr(X) LET arr(X) = arr(X) * X PRINT What is the new Y INPUT.
Chapter 3 Assignment and Interactive Input. 2 Objectives You should be able to describe: Assignment Operators Mathematical Library Functions Interactive.
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.
Conditional Statements If these were easy then everyone would them!
TrueBASIC Ch 4 & 5 Sample Problems. What are the errors? (4 total) INPUT age IF age > 7 THEN PRINT "rollercoaster" ELSE PRINT "ferris wheel" IF age
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Variables, Data Types, & Arithmetic Expressions CSC 1401: Introduction to Programming with Java Lecture 3 Wanda M. Kunkle.
Lecture No: 16. The scanf() function In C programming language, the scanf() function is used to read information from standard input device (keyboard).
Methods. Topics Built-in methods Methods that return a value Void methods Programmer defined methods Scope Top Down Design.
E0001 Computers in Engineering
The University of Texas – Pan American
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Modular Programming Chapter Value and Reference Parameters computeSumAve (x, y, sum, mean) ACTUALFORMAL xnum1(input) ynum2(input) sumsum(output)
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
 Executes a block of code repeatedly  A condition controls how often the loop is executed  Most commonly, the statement is a block statement (set of.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
For loops in programming Assumes you have seen assignment statements and print statements.
Classes Definition A class is a data type whose variables are objects Object – a variable that has member functions as well the ability to hold.
Program add; {program to add 2 numbers and output the result} uses wincrt; begin write('Enter first number: '); readln(first_num); write('Enter second.
Introduction to Computer Programming
Java Arrays and Methods MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
READING AND WRITING FILES. READING AND WRITING FILES SEQUENTIALLY  Two ways to read and write files  Sequentially and RA (Random Access  Sequential.
Chapter 2 Variables.
Lecture 6: Output 1.Presenting results in a professional manner 2.semicolon, disp(), fprintf() 3.Placeholders 4.Special characters 5.Format-modifiers 1.
Data And Variables Chapter Names vs. Values Michael Jordan name (the letter sequence used to refer to something) value (the thing itself)
Python Let’s get started!.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
FUNCTIONS. Midterm questions (1-10) review 1. Every line in a C program should end with a semicolon. 2. In C language lowercase letters are significant.
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Chapter 6 Functions The Tic-Tac-Toe Game. Chapter Content In this chapter you will learn to do the following: 0 Write your own functions 0 Accept values.
Functions. What is a Function?  We have already used a few functions. Can you give some examples?  Some functions take a comma-separated list of arguments.
Introduction to Python Lesson 2a Print and Types.
Control Structures- Decisions. Smart Computers Computer programs can be written to make computers seem smart Making computers smart is based on decision.
Chapter 2 Variables.
Chapter 6 JavaScript: Introduction to Scripting
Chapter 3 Assignment and Interactive Input.
Variables and Expressions
Programming Fundamental
Data types and variables
Introduction to C++.
Formatting Output.
Using local variable without initialization is an error.
Final Exam Review Part 4 - VBA
Review.
Arrays, For loop While loop Do while loop
Overcoming Errors.
Chapter 2 Variables.
Spot the bug!.
Writing Functions( ) (Part 4)
Prepared By: Deborah Becker
Writing Functions( ) (Part 4)
Exercise Solution First questions What's output What's input
Anatomy of a Java Program
JavaScript: Introduction to Scripting
Introduction to Computer Science
Just Basic Lessons 9 Mr. Kalmes.
Chapter 2 Variables.
Basic 9 Mr. Husch.
Class code for pythonroom.com cchsp2cs
Chapter 2 Modular Programs with Calculations and Strings
Presentation transcript:

TrueBASIC Ch 2 & 3 Sample Problems

What are the errors? (2 total) PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50

What are the errors? (2 total) PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50 END 1.REM is a keyword, cannot be used as a variable 2.Missing END statement

What is the output? DATA 1000, 5, "fraternity power walk" READ attendees, ticket_price LET revenue = attendees * ticket_price READ event$ DATA 5, "the fraternity power walk" PRINT event$; " generated $";revenue END

What is the output? DATA 1000, 5, "fraternity power walk" READ attendees, ticket_price LET revenue = attendees * ticket_price READ event$ DATA 5, "the fraternity power walk" PRINT event$; " generated $";revenue END the fraternity power walk generated $ 5000

What is the error? READ yo$, I, got DATA "$",523,432 DATA "100",100 READ number$ READ name PRINT "number": I END

What is the error? READ yo$, I, got DATA "$",523,432 DATA "100",100 READ number$ READ name PRINT "number": I END Commas or Semi-colons must separate the list of arguments to PRINT (not colons)

What are the errors? REM LET x = "5000" LET string$s = "Good Evening" LET 1number = 44 PRINT "I dunno";" whats goin", " on" END

What are the errors? REM LET x = "5000" LET string$s = "Good Evening" LET 1number = 44 PRINT "I dunno";" whats goin", " on" END Cannot assign a string to a number variable string$s is not a valid variable name (must end with $) 1number is not a valid variable name (cannot begin with a number)

What is the output of this program? READ x READ y READ x LET y = x + 2 PRINT "x= ";x, "y= ";y DATA 1,2,3,4,5,6 READ y PRINT "x= ";x, "y= ";y END

What is the output of this program? READ x READ y READ x LET y = x + 2 PRINT "x= ";x, "y= ";y DATA 1,2,3,4,5,6 READ y PRINT "x= ";x, "y= ";y END x= 3y= 5 x= 3y= 4