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

Chapter 4: Loops || A+ Guaranteed.

Note
-
Vendu
-
Pages
9
Qualité
A+
Publié le
04-04-2025
Écrit en
2024/2025

For the given pseudocode, which XXX and YYY will output the sum of the input integers (stopping when -1 is input)? Choices are in the form XXX / YYY. val = Get next input XXX While val is not -1 YYY val = Get next input Put sum to output sum = val / sum = val sum = val / sum = sum + val sum = 0 / sum = sum + val sum = 0 / sum = val correct answers sum = 0 / sum = sum + val For the given pseudocode, which XXX and YYY will output the number of times that 10 is input (stopping when 0 is input)? Choices are in the form XXX / YYY. count = 0 val = Get next input While val is not 0 If val == 10 XXX Else YYY val = Get next input Put count to output count = count + 1 / count = 0 count = count + 1 / (nothing) count = count + val / (nothing) count = count + val / count = 0 correct answers count = count + 1 / (nothing) For the given pseudocode, which XXX and YYY will output the smallest non-negative input (stopping when a negative value is input)? Choices are in the form XXX / YYY. min = 0 val = Get next input min = val While val is not negative If XXX YYY val = Get next input Put min to output val 0 / min = val min val / val = min

Montrer plus Lire moins
Établissement
Chapter 4: Loops
Cours
Chapter 4: Loops

Aperçu du contenu

Chapter 4: Loops || A+ Guaranteed.
For the given pseudocode, which XXX and YYY will output the sum of the input integers
(stopping when -1 is input)? Choices are in the form XXX / YYY.
val = Get next input
XXX
While val is not -1
YYY
val = Get next input
Put sum to output

sum = val / sum = val
sum = val / sum = sum + val
sum = 0 / sum = sum + val
sum = 0 / sum = val correct answers sum = 0 / sum = sum + val

For the given pseudocode, which XXX and YYY will output the number of times that 10 is input
(stopping when 0 is input)? Choices are in the form XXX / YYY.
count = 0
val = Get next input
While val is not 0
If val == 10
XXX
Else
YYY
val = Get next input
Put count to output

count = count + 1 / count = 0
count = count + 1 / (nothing)
count = count + val / (nothing)
count = count + val / count = 0 correct answers count = count + 1 / (nothing)

For the given pseudocode, which XXX and YYY will output the smallest non-negative input
(stopping when a negative value is input)? Choices are in the form XXX / YYY.
min = 0
val = Get next input
min = val
While val is not negative
If XXX
YYY
val = Get next input
Put min to output

val > 0 / min = val
min < val / val = min

, val > min / val = min
val < min / min = val correct answers val < min / min = val

Which input value causes "Goodbye" to be output next?
int x;
x = scnr.nextInt();
while (x >= 0) {
// Do something
x = scnr.nextInt();
}
System.out.println("Goodbye");

-1
0
1
No such value correct answers -1

Which input for char c causes "Done" to be output next?
c = 'y';
while (c = 'y') {
// Do something
System.out.println("Enter y to continue, n to quit: ");
// Get c from input}
System.out.println("Done");

'y' only
'n' only
Any value other than 'y'
No such value (error comparing c and 'y') correct answers No such value (error comparing c and
'y')

What is the output, if the input is 3 2 1 0?
x = scnr.nextInt();
while (x > 0) {System.out.print(2 * x + " ");
}

6
642
6420
6 6 6 6 6 ... (infinite loop) correct answers 6 6 6 6 6 ... (infinite loop)

Which XXX and YYY will loop as long as the input is an integer less than 100? Choices are in
the form XXX / YYY.
w = scnr.nextInt();
while (XXX) {
// Do something

École, étude et sujet

Établissement
Chapter 4: Loops
Cours
Chapter 4: Loops

Infos sur le Document

Publié le
4 avril 2025
Nombre de pages
9
Écrit en
2024/2025
Type
Examen
Contenu
Questions et réponses

Sujets

$11.79
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

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.
SirAnton NURSING, ECONOMICS, MATHEMATICS, BIOLOGY, AND HISTORY MATERIALS BEST TUTORING, HOMEWORK HELP, EXAMS, TESTS, AND STUDY GUIDE MATERIALS WITH GUARANTEED A+ I am a dedicated medical practitioner with diverse knowledge in matters
Voir profil
S'abonner Vous devez être connecté afin de pouvoir suivre les étudiants ou les formations
Vendu
760
Membre depuis
3 année
Nombre de followers
439
Documents
38001
Dernière vente
1 jours de cela
Reign Supreme Scholarly || Enlightened.

Get your revised study materials available here and elevate your educational outcomes. I have numerous verified learning materials (Research, Exams Questions and answers, Assignments, notes etc) for different courses guaranteed to boost your academic results. I am dedicated to offering you the best and unique learning content. You are encouraged to inquire further assistance from this end whenever need be. Kindly remember to leave your review, understanding your satisfaction is essential . We highly appreciate clients who always come back for more of the study content we offer, you are extremely valued. All the best.

Lire la suite Lire moins
3.7

114 revues

5
49
4
20
3
22
2
8
1
15

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