This document provides an introduction and overview for a Visual Logic programming project. It discusses key concepts like variables, input and output statements, and arithmetic expressions. It also presents a sample weekly paycheck program to demonstrate these concepts. The program uses input statements to get employee work hours and pay rate. It then uses an assignment statement to calculate the pay amount as hours times rate. The goal is to teach basic programming logic and syntax.
Ms PowerPoint 2010 Training in Ambala ! Batra Computer Centrejatin batra
Batra Computer Centre is An ISO certified 9001:2008 training Centre in Ambala.
We Provide Best Ms-PowerPoint 2010 Training in Ambala. BATRA COMPUTER CENTRE provides best training in C, C++, S.E.O, Web Designing, Web Development and So many other courses are available.
microsoft office introduction,
topic of microsoft word,microsoft excel and microsoft powerpoint .
features of microsoft office and detail about versions
1)what is an algorithm?
2)problem solving
3)Algorithms: example 1
4)Algorithms: example 2
5)Flowcharts
6)Flowcharts: example 1
2)A guide to understanding flowcharts
Ms PowerPoint 2010 Training in Ambala ! Batra Computer Centrejatin batra
Batra Computer Centre is An ISO certified 9001:2008 training Centre in Ambala.
We Provide Best Ms-PowerPoint 2010 Training in Ambala. BATRA COMPUTER CENTRE provides best training in C, C++, S.E.O, Web Designing, Web Development and So many other courses are available.
microsoft office introduction,
topic of microsoft word,microsoft excel and microsoft powerpoint .
features of microsoft office and detail about versions
1)what is an algorithm?
2)problem solving
3)Algorithms: example 1
4)Algorithms: example 2
5)Flowcharts
6)Flowcharts: example 1
2)A guide to understanding flowcharts
It includes various types of programming errors: Syntax, Semantic, Logical, Runtime Error with the help of C++ programs. Also, discussed how to fix these errors.
For better understanding, subscribe following YouTube channel:
https://youtu.be/PIOCmaYdSCg
Install Addin Excel - Data Analysis Tool Pak - ThiyaguThiyagu K
The Analysis ToolPak is an Excel add-in program
that provides data analysis tools for
financial, statistical and engineering data analysis. We can do statistical analysis in very easily with the use of Data Analysis Tool Pak of Excel Addin. This presentation describes the steps of installing the Addin Software - Data Analysis ToolPak in Excel.
It includes various types of programming errors: Syntax, Semantic, Logical, Runtime Error with the help of C++ programs. Also, discussed how to fix these errors.
For better understanding, subscribe following YouTube channel:
https://youtu.be/PIOCmaYdSCg
Install Addin Excel - Data Analysis Tool Pak - ThiyaguThiyagu K
The Analysis ToolPak is an Excel add-in program
that provides data analysis tools for
financial, statistical and engineering data analysis. We can do statistical analysis in very easily with the use of Data Analysis Tool Pak of Excel Addin. This presentation describes the steps of installing the Addin Software - Data Analysis ToolPak in Excel.
Cis 115 week 7 i lab sales tax solutionarnitaetsitty
CJ 110 MODULE 8 FINAL EXAMINATION
Click Link Below To Buy:
https://hwaid.com/shop/cj-110-module-8-final-examination/
Contact Us:
hwaidservices@gmail.com
This presentation is a part of the COP2272C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce students to the C++ language and the fundamentals of object orientated programming..
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
1. User InterfaceCreate a simple text-based user interface wher.pdfConceptcreations1
1. User Interface:
Create a simple text-based user interface where users can input two numbers and select an
operation (addition, subtraction, multiplication, or division).
2. ArithmeticOperations:
Implement subroutines for each of the selected arithmetic operations.
Ensure that the assembly program can perform addition, subtraction, multiplication, and division
accurately.
3. Input and Output:
Develop code to accept user input for two numbers and the desired operation. Display the result
of the operation to the user.
4. ErrorHandling:
Implement basic error handling to deal with scenarios like division by zero or invalid input.
Provide clear error messages to the user.
5. Testing:
Test the calculator program with various inputs to ensure it produces correct results and handles
errors gracefully.
1. User Interface:
Create a simple text-based user interface where users can input two numbers and select an
operation (addition, subtraction, multiplication, or division).
2. ArithmeticOperations:
Implement subroutines for each of the selected arithmetic operations.
Ensure that the assembly program can perform addition, subtraction, multiplication, and division
accurately.
3. Input and Output:
Develop code to accept user input for two numbers and the desired operation. Display the result
of the operation to the user.
4. ErrorHandling:
Implement basic error handling to deal with scenarios like division by zero or invalid input.
Provide clear error messages to the user.
5. Testing:
Test the calculator program with various inputs to ensure it produces correct results and handles
errors gracefully.
Description and Instructions
Overview
This project introduces beginners to assembly language programming, a low- level programming
language.
It covers essential concepts like arithmetic operations, user input, and error handling.
The project is small in scope and allows beginners to get a taste of programming in assembly
without overwhelming complexity.
Project Title: "Assembly Language Calculator"
Description:
Create a basic calculator program in assembly language that allows users to input two numbers
and perform addition, subtraction, multiplication, or division. The program should display the
result and handle basic error scenarios, like division by zero.
In this project, you will create a basic calculator program using assembly language. This project
serves as an introduction to assembly language programming and covers fundamental arithmetic
operations. Here's how the project can be structured:
Pg. 02 Description and Instructions
1. User Interface:
Create a simple text-based user interface where users can input two numbers and select an
operation (addition, subtraction, multiplication, or division).
2. ArithmeticOperations:
Implement subroutines for each of the selected arithmetic operations.
Ensure that the assembly program can perform addition, subtraction, multiplication, and division
accurately.
3. Input and Output:
Develop code to accept user input f.
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docxmelbruce90096
Week 2 iLab
TCO 2 — Given a simple problem, design a solution algorithm that uses arithmetic expressions and built-in functions.
Scenario
Your goal is to solve the following simple programming exercise. You have been contracted by a local antique store to design an algorithm determining the total purchases and sales tax. According to the store owner, the user will need to see the subtotal, the sales tax amount, and the total purchase amount. A customer is purchasing four items from the antique store. Design an algorithm where the user will enter the price of each of the four items. The algorithm will determine the subtotal, the sales tax, and the total purchase amount. Assume the sales tax is 7%.
Be sure to think about the logic and design first (input-process-output (IPO) chart, flowchart, and pseudocode). Display all output using currency formatting.
Advanced (optional): Use a constant for the 7% sales tax.
Rubric
Point distribution for this activity:
iLab Activity
Document
Points possible
Points received
Variable list
10
IPO chart
10
Flowchart
10
Pseudocode/C# code
10
Desk-check
10
Total Points
50
Name:_________________
(1) Variable List With Data Type
List all the variables you will use (use valid variable names). Indicate whether the data type is string, integer, or double, and so on.
(2) IPO Model
List the inputs, any processes, calculations, and outputs. Use the same valid variable names you used in Step 1.
Inputs
Process (calculations)
Outputs
(3) Flowchart
Use MS Visio to create a flowchart. Paste the flowchart here, or attach as separate document. Use the same valid variable names you used in Step 1.
(4) Pseudocode or C# Code
Describe your solution using pseudocode or actual C# code. Use the same valid variable names you selected in Step 1.
(5) Desk-Check
Desk-check your solution by selecting appropriate test data.
Test data: List the values for your test data.
Expected output: What is the expected output of your program?
Step
Variables (write variable names in first line below)
Output
Enter step numbers
1
2
3
Week 2 Activity—Game Seating Charges
TCO 2—Given a simple problem, design a solution algorithm that uses arithmetic expressions and built-in functions.
Assignment
Your goal is to solve the following simple programming exercise. You have been contracted by a local stadium to design an algorithm determining the total seating charges for any game held at the stadium. Lower-level seats cost $25 per seat, mid-level seats cost $15 per seat, and upper-level seats cost $10 per seat. The algorithm should ask the user for the number of seats being purchased in each seating level. Then, the algorithm will determine the total for each level and a grand total for the enti.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
Visual Logic Project - 1
1. Visual Logic - Project 1
Introduction
This project lays the foundation for programming as a problem-
solving technique. Basic concepts of input and output are covered, as well
as the distinction between logic and syntax of a particular programming
language.
In this project you will learn that…
• Variables are storage locations used for holding input and processing
information.
• Each variable has two components: its name and its value.
• Input statements are used to get data into variables.
• Expressions are value-returning code elements.
• Assignment statements are used to perform calculations and store the
result.
• Output statements are used to display information.
• Input, assignment, and output statements are sufficient to write small
programs.
Case Study (Grocery Checkout)
This project covers input, processing, and output statements, the
minimum functions necessary for a useful computer information system.
After discussing these three statements, we will develop a working grocery
checkout program. Our solution will input the purchase price of three items
in the store. The program will determine the total price of all three items,
add 6 percent sales tax, and display the resulting totals. The solution is
presented later in this project.
1-1“Hello World”
It is a time-honored tradition that your first program in any language
be the output message ''Hello World.” We will follow suit and write a Hello
World program using Visual Logic.
Begin by running the Visual Logic program contained on with this
text. When the program begins, you will see two flowcharting elements,
Begin and End, connected by a flow-arrow. Click the left mouse button on
the flow- arrow; the Flowchart Elements menu should pop up (Figure 1-1).
2. Select Output from the popup menu to add an output element to your
flowchart. Then double-click on the newly added output element, opening
the output dialog box. Type “Hello World'' (make sure that you include the
double quotes) in the text box, and then click the OK button. Figure 1-2
shows how your flowchart should look after closing the dialog box.
3. Press F5 to run the program. The program executes, generating an
output dialog box that appears with the text “Hello World'' (Figure 1-3).
Congratulations! You have just written your first computer program!
1-2 Logic and Syntax
A computer program is a solution to a problem, such as, how can
customers view and purchase products over the Internet?” or, “How can
sales representatives have immediate and accurate access to inventory data?”
Each program (or solution) has two components, its algorithm and its syntax.
An algorithm is the logical design used to accomplish a specific objective.
Various tools for representing computing algorithms are available, the two
most common being flowcharts and pseudocode. In this part of the course
we will use Visual Logic, which combines the utility of flowcharts
(graphical representations of algorithms) and pseudocode (a nontechnical
description of an algorithm) with computer simulation. Using Visual Logic,
computer algorithms may be written, saved, edited, executed, and debugged.
Once an algorithm has been developed, it must be communicated in
an appropriate language. To communicate actions to a computer, developers
use a programming language like Visual Basic, Cs#, C++, Java, Pascal, or
Cobol (among others). Syntax refers to the specific rules of a programming
language. There are literally hundreds of programming languages to choose
from, each with its own unique syntax. Therefore, writing a computer
program involves creating a logical design to solve a problem and then
implementing that design in an appropriate syntax.
An information system is a combination of people and technology
(computers) that collect, organize and process data to produce information.
For any information system to be useful, it must do at least three things:
input data into the system, process data within the system, and output
resulting information from the system. For example, an online catalog
information system might have input that includes the product ID for the
items a customer wishes to purchase, along with the customer’s mailing
address and credit card number. The processing could include referencing a
database to determining the cost of each item, calculating the sales tax,
computing the shipping charge based on the customer’s mailing address, and
billing the customer’s credit card the appropriate amount. The output might
include a customer receipt and reports for the sales department and the
warehouse.
4. 1-3 Input Statements
Remember that an information system must input data into the
system, process data within the system, and output resulting information
from the system. The first of those three tasks, inputting data into the
system, is accomplished by means of an input statement. An input statement
accepts data from the user and stores that data into a variable. A variable is a
storage location that can be accessed and changed by developer code. A
variable has a name (which does not change) and an associated data value
(which may change during execution).
To understand the input statement, consider the following
modification to the Hello World program you just wrote. Click on the flow-
arrow above the output statement and add an input element. Double-click on
the input element, opening the input element dialog box. Type “Name”
(without the quotes) in the variable textbox and press OK. Then double-click
on the output element and change the text in the dialog box to read “Hello “
& Name (using quotes around “He1lo '' but not around Name). Your
solution should now look like Figure 1-4.
Run the program. You will be prompted to type a value for Name.
Enter your name inside double quotes (e.g., “Dave”'). The program will then
display a message box with the appropriate greetings (e.g., “Hello Dave”;
5. see Figure 1-5).
Simple Programming Formats
The Hello Name program uses an input statement to prompt the user
for a value that is stored and then reused in an output statement. The value
entered at the input prompt can be either numeric (e.g., 42 or 3.14159) or a
string (e.g., “Dave'' or “Go Big Red''). Be aware that string input data must
be entered within double quotes.
There are some constraints with numeric data as well. Most
programming languages do not allow numeric input to include symbols such
as the percent symbol (%) or dollar sign ($) or even commas (,). Numeric
input should consist of only digits and possibly one decimal point. You will
quickly get used to using proper numeric notations for programming. Table
1-1 summarizes some common numeric notations and the correct
programming format.
6. Variable Summary
• Variables are storage locations used for holding data and information.
• Each variable has two components: its name (which does not change)
and its value (which may change during execution).
•
Input Statement Summary
• Input statements are used to get data into variables.
• In Visual Logic, the input flowchart element is a parallelagram with
the keyword Input followed by the variable name.
• When the input statement is executed, the user is prompted to enter a
value using the keyboard. The value typed is then stored in the
variable for later use.
• String input must be placed inside double quotes.
• Numeric input must contain only digits and possibly one decimal
point. Percent symbols (%), dollar signs ($), and commas (,), among
other symbols, are not allowed.
•
1-4 Weekly Paycheck Program
You have now written your first two computer programs, Hello World
and Hello Name. Your third program will be a bit more complicated. You
will now write a weekly paycheck program that accepts the hours worked
and the hourly rate for an employee and the program will calculate and
display the appropriate pay amount due to the employee for the current
week. This weekly paycheck program will use all three basics of an
information system-input, processing, and output-and will be developed in
steps.
The weekly paycheck program has two input variables, Hours and
Rae. Start the Visual Logic System. (If it is already running, under the menu
click File, then New) Click on the flow-arrow and select the input element.
Repeat to add a second input element. Then double-click on each element to
add the variable names Hours and Rate (Figure 1-6). The input for the
weekly paycheck program is now complete.
7. 1-5 Assignment Statements
The assignment statement can be used to perform a calculation and
store the result. Addition ( + ), subtraction ( -), multiplication (*), and
division (/) are common arithmetic operations found in almost every high-
level programming language. Note that the multiplication operator is
typically an asterisk (*) rather than the traditional times operator ( X ),
because X could be mistaken as a variable name.
To illustrate the use of the assignment statement, we return to the
weekly pay- check program. You have already used two input statements to
accept the data Hours and Rate. An assignment statement will be added to
process that data. The required calculation is straightforward. Hours times
rate produces the pay amount due.
Returning to Visual Logic, click on a flow-arrow below the two input
statements, and then select an assignment element from the menu. Double-
click the assignment element to open the assignment edit dialog. The text
box on the left is labeled Variable, and the text box on the right is labeled
Expression. An expression is a value-returning code element, such as a
variable or mathematical formula. Most programming languages follow this
tradition of specifying the expression on the right hand side (RHS) of the
assignment statement, and the variable to store the result on the left hand
side (LHS) of the assignment statement. When executed, the right hand side
expression is evaluated first. The result of the expression is then stored into
8. the left hand side variable.
Enter “Hours * Rate” (without the quotes) in the right hand expression
text box and PayAmount in the left hand text box. When finished, your
solution should look like Figure 1-7. Your program now accepts two input
values and performs an appropriate
calculation based on those input values.
Assignment Statement Summary
• Assignment statements are used to
perform calculations and store the
result.
• In Visual Logic, the assignment
flowchart element is a rectangle with a
variable on the left hand side (LHS)
and an expression on the right hand
side (RHS).
• When executed, the expression is
evaluated and the result is stored in the
variable.
How to Write Arithmetic Expressions
The calculation in the weekly paycheck program is rather
straightforward (hours times rate). As a developer, you will often have to
perform calculations that are significantly more complex. Visual Logic
supports seven arithmetic operators, evaluated in the order of operator
precedence shown in Table 1-2. Operators of the same precedence are
evaluated left-to-right. Parentheses can be used to override the default
precedence order.
9. There are three operators related to division. Regular division (/)
produces a decimal value if necessary. Integer division ( ) and integer
remainder (Mod) require integer arguments and produce an integer answer.
Integer division is the integer result, throwing away any remainder. Integer
remainder is the amount leftover after taking out as many whole occurrences
of the numerator from the divisor as possible.
1-6 Output Statements
Output can occur in many forms. Two common types of output are
screen output and printed output, both of which are visual. Sound output is
common through speakers. Eventually we will probably have output
involving the other senses (touch, smell, and taste) as well. Information
saved to a storage device such as a floppy disk, hard disk, or CD is also
considered to be a form of output.
An output statement uses a dialog box to display an expression. We
conclude the paycheck program by adding an output dialog that displays an
appropriate message to the user. Add an output element to your flowchart,
and then double-click the element to enter the output expression. In the text
box, type:
“Pay amount do. is “ & FormatCurrency(PayAmount)
Save this output expression. Your completed flowchart should look like
Figure 1-8.
10. Press F5 to run the program. The program prompts the user to enter a
value for hours, and then prompts the user again for a value for rate. The
calculation is made and the information is displayed to the user in an output
dialog box. For example, Figure 1-9 shows the output generated by input
values of 30 hours and 8 dollars per hour rate.
Congratulations! You have just written your third computer program!
From the Visual Logic menu, select File->Save to save this program. We
will revise this program in Project 2.
11. Intrinsic Functions
The Weekly Paycheck Solution uses the intrinsic emotion
FormatCurrency() to display a numeric value in a currency format, including
a leading dollar sign, two decimal places, and delimiting commas as
necessary. Intrinsic functions are predefined commands that provide
developers with common, helpful functionality. Intrinsic functions are
divided into several categories, including math functions, business functions,
string functions, time and date functions, conversion functions, file access
functions, and so on. Another intrinsic function is FormatPercent(), which
takes a decimal percent value and converts it to its equivalent value with a
percent symbol and two decimal places. Abs() accepts a numeric value and
produces the absolute value equivalent. Int() accepts a decimal value and
produces the integer whole value. Round() accepts a decimal value and
produces the nearest integer value. Finally, Random() accepts an integer
value N and produces a random integer between O and (N-1). Table 1-4
shows examples of these intrinsic functions.
12. Output Statement Summary
• Output statements are used to display information.
• In Visual Logic, the output flowchart element is a parallelogram with
the keyword Output followed by an output expression.
• When executed, string literals are displayed exactly as typed inside
the containing quotes.
• When executed, expressions are evaluated and the result is displayed.
1-7 Debugging with Visual Logic
Even the best developers will eventually make mistakes. A
programming mistake is often called a bug, although the term error is
probably more appropriate. Visual Logic provides debugging support to help
you track down and fix your errors. Figure 1-10 shows the execution and
debugging portion of the Visual Logic standard toolbox. Note that these
functions are also available under the Debug menu item. Run is the
command that executes the simulator. Pause stops the simulation on the
current command. Terminate ends the execution of the current program.
The last two options, Step Into and Step Over, allow a paused
program to execute one step at a time. When the program's paused, the
Variable Watch window appears displaying the current values for all
program variables. Step into takes you to the next command, and will go into
a structure like a condition or a loop (which we discuss in the following
projects). Step Over takes you to the next command at the same level as the
current command. Using the step commands to study the program variable
values as each statement executes can be helpful in determining why your
program is generating an error.
13. Case Study – Grocery Checkout
Our grocery checkout problem requires three input values (the prices
of the three items), three calculations (the subtotal of the three items the
appropriate sales tax, and the resulting total), and a single output (the
resulting total). Let us see how this can be done in Visual Logic. Below are
the steps we use when solving this problem.
1 . From the visual Logic menu, select File->New to start a new program.
Add three input elements to your flowchart. Enter the variable names Iteml,
Item2, and Item3 respectively.
2. Add an assignment element to your flowchart.
Enter subtotals as the result variable, and enter
Iteml + Item2 + Item3 as the expression.
3. Add a second assignment element to your
flowchart. Set the variable salesTax to be the
result of the expression subtotal * 0.06 .
4. Add c third assignment element that sets Total
to be the sum of SubTotal + SalesTax.
5. Display the Total with an appropriate output
statement. Your solution should look something
like Figure 1-11
6. Run your program to see if it works. If the input
values ore 10, 20, and 30, the output should be
“Your purchase total is $63.60.”
After finishing the program, you might ask,
“There are three assignment statements in the
solution. Can it be done with only one assignment
statement?''
The answer is yes. You could have set Total
equal to the following:
Total = (Item l + Item2 + Item3) * 1.06
Both solutions are right because they both produce
the correct result. It is a subjective question as to
which, if either, is the better solution.
14. Review Questions
1. Consider the similarities and differences between developing an algorithm
and developing syntax. What skills are required for each activity? What is
the added value for each activity?
2. Identify possible input, processing, and output for a video store's rental
checkout system.
3. Imagine you are an entrepreneur with access to some of the Innovative
output technologies regarding smell, touch, and taste. Identify some business
uses of these technologies that you think might become profitable.
15. Programming Exercises
1-1. Run the Numbers. Write a program with two input valued. The
program should display the sum, difference, quotient, product, and average
of the two numbers.
1-2. A Rose by any Other Name. Paulette has just planted a large rose
garden that she wants to fertilize. She knows the area of her rose garden in
square feet, but the fertilizer is measured by the square yard. Write a
program that converts square feet (input) to square yards (output).
1-3. “As I was gong to St. Ives . . .” consider the following nursery rhyme:
As I was going to St. Ives, I met a man with seven wives. Every wife
had seven sacks, every sack had seven cats, and every cat had seven
kittens. Kittens, cats, sacks, and wives, how many were going to St.
Ives?
The question at the end of the rhyme is a trick question because only the
narrator is going to St. Ives. Write a program to determine the total number
of things (including people, animals, and sacks) that were met by the
narrator.
1-4. Twenty thousand Leagues Under the Sea. Jules Verne's Twenty
Thousand Leagues Under the Sea is the story of Captain Nemo and his
fantastic submarine Nautilus. The story is told from the perspective of
Professor Aronnax, who entered the Nautilus as a prisoner but later is treated
as a guest. It is a story of intrigue and suspense, of respect and revenge. At
one point the professor writes, “I have crossed 20,000 leagues in that
submarine tour of the world, which has revealed so many wonders.'' You can
read the book online at The University of Virginia's Electronic Text Center,
http'//etext.lib.virginia.edu
Perform an Internet search to find the conversion ratios between
leagues and nautical miles. Then write a program that converts leagues into
nautical miles and run your program to see how many nautical miles
Professor Aronnax traveled.
1-5. Jake's Problem. Jake has a car with an 8-gallon fuel tank. Jake fills his
tank with gas and then drives 60 miles to a friend's house. When he gets to
his friend's house, he has 6 gallons left in his fuel tank. Write a program that
16. uses three input elements to enter values for tank size, miles traveled and
gallons left. The program should calculate and display how many miles Jake
can drive on a full tank of gas. (Note: Be sure to use Input elements to accept
the values 8, 60, and 6 rather than hard coding them into your solution.)
1-6. Correct Change. Write a program to assist a cashier with determining
correct change. The program should have one input, the number of cents to
return to the customer. The output should be the appropriate change m
quarters, dimes, nickels and cents. Hint: Consider how integer division ( )
and integer remainder (Mod) can be used as part of your solution.