Chapter 1: Problem 18
A variable must be __________ before it can be used in a program.
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 1: Problem 18
A variable must be __________ before it can be used in a program.
All the tools & learning materials you need for study success - in one app.
Get started for free
A program is a set of ______.
The rules that must be followed when constructing a program are called __________.
Are programs expressed as English statements. What would each display on the screen if they were actual programs? The variable x starts with the value 0. The variable y starts with the value 5. Add 1 to x. Add 1 to y. Add x and y, and store the result in y. Display the value in y on the screen.
The variable a starts with the value 1. The variable b starts with the value 10. The variable c starts with the value 100. The variable x starts with the value 0. Store the value of c times 3 in x. Add the value of b times 6 to the value already in x. Add the value of a times 5 to the value already in x. Display the value in x on the screen.
Available Credit Design a hierarchy chart for a program that calculates a customer鈥檚 available credit. The program should carry out the following steps: 1\. Display the message 鈥淓nter the customer鈥檚 maximum credit.鈥 2\. Wait for the user to enter the customer鈥檚 maximum credit. 3\. Display the message 鈥淓nter the amount of credit used by the customer.鈥 4\. Wait for the user to enter the customer鈥檚 credit used. 5\. Subtract the used credit from the maximum credit to get the customer鈥檚 available credit. 6\. Display a message that shows the customer鈥檚 available credit.
What do you think about this solution?
We value your feedback to improve our textbook solutions.