Question: Your downloadable files for Chapter 1 2 include DEBUG 1 2 - 0 1 . txt , DEBUG 1 2 - 0 2 . txt
Your downloadable files for Chapter include DEBUGtxt DEBUGtxt DEBUGtxt and DEBUGjpg Each file starts with some comments that describe the problem. Comments are lines that begin with two slashes Each file contains pseudocode or a flowchart that has mistakes. Find and correct all the bugs.
DEBUG txt
This is a Label class.
It defines a label that can appear on a GUI screen.
class Label
Declarations
private string text
private num horizontalPosition
private num verticalPosition
public void setText
text message
return
public void setPositionx y
horizontalPosition x
verticalPosition x
return x
endClass
DEBUGtxt
This program creates a screen with a button.
When the user clicks the button, a label displays "Hello".
start
Declarations
Screen screen new Screen
Button helloButton new Button
Label helloLabel new Label
screensetSize
helloButton.setTextClick to see a greeting
helloButton.registerListenergreetingMethod
helloLabel.setTextHello
screenaddhelloLabel
stop
greetingMethod
return
DEBUGtxt
This program creates a screen with a textbox and a button.
When the user clicks the button, a label displays the result
which is of the number in the textbox.
start
Declarations
Screen screen new Screen
Button calcButton new Screen
Textbox usersEntry new TextBox
Label result
screensetSize
calcButton.setTextClick to calculate tax"
screenaddusersEntry
screenaddbutton
stop
calculateTax
Declarations
Label result new Label
num tax
num RATE
string answer
tax usersEntry.getText RATE
answer "The tax is tax
result.setText
screenaddresult
return
DEBUGjpg
These storyboard sketches have been created for an interactive program that accepts customers'
drink orders and displays a price. The user makes choices and a price is calculated based on type and
size of drink and applicable tax. An object dictionary appears below the storyboard sketches. Correct
the bugs.
Regular
Diet
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
