Rédigé par des étudiants ayant réussi Disponible immédiatement après paiement Lire en ligne ou en PDF Mauvais document ? Échangez-le gratuitement 4,6 TrustPilot
logo-home
Examen

Programming Logic and Design Chapter 3 Review Questions Complete Answers

Note
-
Vendu
-
Pages
6
Grade
A+
Publié le
22-03-2025
Écrit en
2024/2025

Programming Logic and Design Chapter 3 Review Questions Complete Answers

Établissement
Programming Logic And Design
Cours
Programming Logic and Design

Aperçu du contenu

Programming Logic and Design
Chapter 3 Review Questions Complete
Answers

Which of the lettered choices is equivalent to the following decision?

if x > 10 then
if y > 10 then
print "X"
endif
endif

a. if x > 10 AND y > 10 then print "X"
b. if x > 10 OR y > 10 then print "X"
c. if x > 10 AND x > y then print "X"
d.if y > x then print "X" - ANSWER-if x > 10 then

The Acme Computer Company operates in all 50 of the United States. The Midwest
Sales region consists of five states--Illinois, Indiana, Iowa, Missouri, and Wisconsin.
Suppose that you have input records containing Acme customer data, including state
of residence. To most efficiently select and display all customers who live in the
Midwest Sales region, you would use ___________.

a. five completely separate unnested if statements
b. nested if statements using AND logic
c. nested if statements using OR logic
d.Not enough information is given. - ANSWER-c. nested if statements using OR logic

The Midwest Sales region of Acme Computer Company consists of five states—
Illinois, Indiana, Iowa, Missouri, and Wisconsin. About 50 percent of the regional
customers reside in Illinois, 20 percent in Indiana, and 10 percent in each of the
other three states. Suppose you have input records containing Acme customer data,
including state of residence. To most efficiently select and display all customers who
live in the Midwest Sales region, you would ask first about residency in
_____________.

a. Illinois
b. Indiana
c. Either Iowa, Missouri, or Wisconsin--It does not matter which one of these three
are first
d. Any of the five states; it does not matter which one is first - ANSWER-a. Illinois

The Boffo Balloon Company makes helium balloons. Large balloons cost $13 a
dozen, medium-sized balloons cost $11 a dozen, and small balloons cost $8.60 a
dozen. About 60 percent of the company's sales are the smallest balloons, 30

, percent are the medium, and large balloons constitute only 10 percent of sales.
Customer order records include customer information, quantity ordered, and size.
When you write a program to determine price based on size, for the most efficient
decision, you should ask first whether the size is _____________.

a. large
b. medium
c. small
d. It does not matter. - ANSWER-c. small

The Boffo Balloon Company makes helium balloons in three sizes, 12 colors, and
with a choice of 40 imprinted sayings. As a promotion, the company is offering a 25
percent discount on orders of large, red "Happy Valentine's Day" balloons. To most
efficiently select the orders to which a discount applies, you would use
_____________.

a. three completely separate unnested if statements
b. nested if statements using AND logic
c. nested if statements using OR logic
d. Not enough information is given. - ANSWER-b. nested if statements using AND
logic

Radio station FM-99 keeps a record of every song played on the air in a week. Each
record contains the day, hour, and minute the song started, and the title and artist of
the song. The station manager wants a list of every title played during the important
8 a.m. commute hour on the two busiest traffic days, Monday and Friday. Which
logic would select the correct titles?

a. if day = "Monday" OR day = "Friday" OR hour = 8 then
print title
endif

b. if day = "Monday" then
if hour = 8 then
print title
else
if day = "Friday" then
print title
endif
endif
endif

c. if hour = 8 AND day = "Monday" OR day = "Friday" then
print title
endif

d. if hour = 8 then
if day = "Monday" OR day = "Friday" then
print title
endif

École, étude et sujet

Établissement
Programming Logic and Design
Cours
Programming Logic and Design

Infos sur le Document

Publié le
22 mars 2025
Nombre de pages
6
Écrit en
2024/2025
Type
Examen
Contient
Questions et réponses

Sujets

€12,48
Accéder à l'intégralité du document:

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF


Document également disponible en groupe

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
lectknancy Boston University
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
303
Membre depuis
2 année
Nombre de followers
28
Documents
26115
Dernière vente
4 jours de cela

3,7

72 revues

5
33
4
12
3
11
2
4
1
12

Documents populaires

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions