Preparing for Assignment 3. Setup Assignment 3 builds on Assignment 2, and we are using the same basic scenario. Save the spreadsheet you used for Assignment.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

RollCall is a feature recently added to ControlSoft It allows you to have groups of devices checked periodically to see if they are working. The results.
Microsoft Excel. Click on “Start,” then “Microsoft Office Excel.”
Tutorial 8: Developing an Excel Application
30/04/ Selection Nested If structures & Complex Multiple Conditions.
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
Chapter 3 Planning Your Solution
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Introduction to VBA. This is not Introduction to Excel We’re going to assume you have a basic level of familiarity with Excel If you don’t, or you need.
BTEc unit 12 software development
Press Esc to Exit ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in.
Creating Embedded Formative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
Assignments  1. Grade graphs and conclusions.  2. Introduction to Reaction Time.  3. Begin Pre-Lab of Reaction Time.
VBA (Visual Basic for Applications) What is Excel, just a spreadsheet? Time for Demos...
©2008 TTW Where “Lean” principles are considered common sense and are implemented with a passion! Product Training System Data Setup and.
Scoring Program Updates & XML upload to the NSRCA web site July 2013.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
Week 8.  Recap  User Forms  Input Validation Message Boxes Input Boxes  Conversion Functions.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
General Programming Introduction to Computing Science and Programming I.
Visual Basic Games: Prepare for Hangman
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Using Visual Basic for Applications (VBA) – Project 8.
Chapter 4: The Selection Process in Visual Basic.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
1 ADVANCED MICROSOFT EXCEL Lesson 9 Applying Advanced Worksheets and Charts Options.
Designing with Procedures 1. Designing a Program with Procedures If the code for your program is going to be less than one page, normally don’t bother;
Remember…  Please do not…  Change the background.  Change the icons.  Change the font. Use Times New Roman (size 12 font).  Use color. We cannot print.
Copyright © 2001 by Wiley. All rights reserved. Chapter 4: The Selection Process in Visual Basic Selection Process Two Alternative Structure If..Then..ElseIf.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
ArcObject. Chapter 8 Chapter 7: Coding a For loop A For loop begins with the For keyword and ends with the Next keyword. The For keyword on the first.
MS Visual Basic Applications Walter Milner. Event-driven programming Standard approach for GUIs Contrast with old character interfaces – program determines.
CTS130 Spreadsheet Lesson 19 Using What-If Analysis.
1 CS 106 Computing Fundamentals II Chapter 81 “Error Handling” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
Programming with Microsoft Visual Basic th Edition
P6 BTEC Level 3 Subsidiary Diploma in ICT. Automation The end user of a spreadsheet may be proficient in using the software, but the more that you automate.
1 CS105 Discussion 5 – Variables and If Announcements MP 1 due on Monday Midterm 1 on Tuesday If you need a conflict, request it NOW!!
ME 142 Engineering Computation I Using Subroutines Effectively.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
1 Project 3 The Kumquat Society Conference. 2 Conference Registration In this project you will write a program to handle a conference registration. The.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Program 03 Fall 2014 VB Auto Center Problem Purpose: VB Auto Center has ask you to write a program that will calculate the typical values involved in the.
ME 142 Engineering Computation I Using Subroutines Effectively.
# 1# 1 What is a variable that you create? What is a constant that you create? What is an intrinsic (built-in) constant? What variables are built in?
Lab 10. User Forms Design – Code Part ► Lab 9 Review ► Continue ‘Student Record’ Example ► A Car Loan Application.
1 CS 106 Computing Fundamentals II Chapter 210 “Adding Controls to User Forms” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
Remember…  Please do not…  Change the background.  Change the icons.  Change the font. Use Times New Roman (size 12 font).  Use color. We cannot print.
The Hashemite University Computer Engineering Department
31/01/ Selection If selection construct.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
Controlling Program Flow with Decision Structures.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Macros in Excel Using VBA Time Required – 5 hours.
A step-by-Step Guide For labels or merges
Development Environment
IE 8580 Module 4: DIY Monte Carlo Simulation
For Letters, Labels or s Mail Merge For Letters, Labels or s.
An Introduction to Programming and VB.NET
VBA (Visual Basic for Applications) What is Excel, just a spreadsheet?
Excel VBA Day 3 of 3 Tom Vorves.
Understand the Programming Process
Tonga Institute of Higher Education
Understand the Programming Process
Problem Solving Designing Algorithms.
Presentation transcript:

Preparing for Assignment 3

Setup Assignment 3 builds on Assignment 2, and we are using the same basic scenario. Save the spreadsheet you used for Assignment 2 as YourNameAssignment3, making sure it’s a macro-enabled workbook You will again have a model Ice Cream Order to follow along with, building on the first version used for Assignment 2

Before Writing the Code: Requirements Remember, writing is the third step of the process, not the first! Start by reviewing the requirements and making up some use cases and tests. You will need at least five or six tests to do a good job Think about the process. What should happen first? What next? Work through a typical use case on paper

Before Writing the Code: Specification Start by making a plan. If you don’t want to do a flowchart for the whole program, write down the major steps in English (this is called “pseudo code”) Think about what variables and constants you might need We used our pseudo code steps as major comments in our code; you can write these first and then fill in You will need to hand in a flow chart for the conditionals that control what happens with the option buttons

Writing the Code It is a HUGE mistake to write all the code and then try to debug it Write a small piece and run it to make sure it works. Then write another small piece This way if there is a bug you know it is probably in the small piece of new code you just wrote. You don’t have to hunt for it through the new program If you get a runtime error, click on debug and VBA will highlight the line where the error occurred. You can also step through your code.

Give Yourself Enough Time Things may go well but when writing code it is common to get a hard-to-find bug or two Start early so you have plenty of time to hunt them down Use the TA and the message boards, but please don’t post large chunks of code on the boards; you can mail code to the TA if you want him or her to look at it

A FEW NEW TOOLS…

The UserForm_Initialize Event UserForm_Initialize is similar to Workbook_Open; it’s an event routine that is called when the form is loaded into memory We used named constants to define the various prices for options; the labels for the buttons and check boxes are completed using these at load time This allows us to provide the information in one place only, so it is easy to change if we need to

Formatting We used formatting functions to make our numbers print nicely Format(TIPPERCENT, "Percent") formats the number TIPPERCENT, which is a constant equal to.15, as 15% We also used the “Currency” format. Note: if you bought your computer in another country, it may format in a currency other than dollars. This is OK; you don’t have to change it.

Error Handling In a well-written program, user mistakes are caught and the user is given a chance to correct them Often this type of code is a large, even major, part of the program We haven’t done much in this regard yet but we did catch the mistake if no commission option is selected

Note error handling in the Else clause If optVanilla.Value = True Then flavorName = "vanilla" flavorPrice = VANILLAPRICE ElseIf optChocolate.Value = True Then flavorName = "chocolate" flavorPrice = CHOCOLATEPRICE ElseIf optStrawberry.Value = True Then flavorName = "strawberry" flavorPrice = STRAWBERRYPRICE Else 'no option chosen MsgBox ("You need to select a flavor") Exit Sub End If