Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Overig

D335 Introduction to Programming in Python (PA study guide 2025) Western Governors University

Beoordeling
-
Verkocht
-
Pagina's
23
Geüpload op
16-05-2025
Geschreven in
2024/2025

D335 Introduction to Programming in Python (PA study guide 2025) Western Governors University 20.01 Practice Lab 1 (Introduction to Java) INSTRUCTIONS: Write a program that outputs the pattern shown below, ending with a newline. Each line of the pattern contains 5 characters including whitespace. OUTPUT: H H H H HHHHH H H H H SOLUTION (in red): public class Lab { public static void main(String[] args) { /* Type your code here. */ Sln("H H"); Sln("H H"); Sln("HHHHH"); Sln("H H"); Sln("H H");

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

D335 Introduction to Programming in Python (PA study
guide 2025) Western Governors University

20.01 Practice Lab 1 (Introduction to Java)

INSTRUCTIONS:
Write a program that outputs the pattern shown below, ending with a newline. Each line of the pattern contains 5
characters including whitespace.

OUTPUT:
H H
H H
HHHHH
H H
H H

SOLUTION (in red):

public class Lab {
public static void main(String[] args) {
/* Type your code here. */
System.out.println("H H");
System.out.println("H H");
System.out.println("HHHHH");
System.out.println("H H");
System.out.println("H H");
}
}

WALKTHROUGH:
Just pay attention to how many characters are required on each line and use System.println();




20.02 Practice Lab 2 (Multiplication)

INSTRUCTIONS:
For this lab you will use unit testing to check a null setting using assertions. Use the commented template code
provided to do the following:

Write a program that collects two integer inputs and assigns them to the variables starting_num and multiplier.
Multiply starting_num by multiplier and output the result. Repeat this process two more times, each time
multiplying the previous result by multiplier. The three product outputs should be separated by a whitespace
character, ending with a newline.

,If the input is:
25
the output when starting_num = 2 is: 10
50 250

, SOLUTION (in red):

import java.util.Scanner; public
class LabProgram {
public static void main(String[] args) { Scanner
scnr = new Scanner(System.in);
/* Type your code here. */

int num1 = scnr.nextInt();
int num2 = scnr.nextInt();

int starting_num = num1;
int multiplier = num2;

int result1 = starting_num * multiplier;
int result2 = result1 * multiplier;
int result3 = result2 * multiplier; System.out.println(result1
+ " " + result2 + " " + result3);
}
}

OR

int starting_num = scnr.nextInt(); int
multiplier = scnr.nextInt();

for (int i = 0; i < 3; i++) { result
*= multiplier;
System.out.print(result);

if (i < 2) {
System.out.print(“ “);
}
}
System.out.println();




20.03 Practice Lab 3 (Wedding Tables)
INSTRUCTIONS:
Write a program that calculates the number of full tables for a wedding event, based on the number of expected
guests. Each full table will seat 10 wedding guests.

Collect one integer input and assign it to the variable guests. Using integer division, calculate the total number of
tables that will be filled. The variable tableSize has been declared and initialized and the variables guests and
tablesFilled have been declared in the template code.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
16 mei 2025
Aantal pagina's
23
Geschreven in
2024/2025
Type
OVERIG
Persoon
Onbekend

Onderwerpen

€14,30
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kan je een ander document kiezen. Je kan het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
smartzone Liberty University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
3295
Lid sinds
6 jaar
Aantal volgers
2295
Documenten
14607
Laatst verkocht
14 uur geleden
AMAIZING EDUCATION WORLD

GET ALL KIND OF EXAMS ON THIS PAGE ,COMPLETE TEST BANKS,SUMMARIES,STUDY GUIDES,PROJECT PAPERS,ASSIGNMENTS,CASE STUDIES, YOU CAN ALSO COMMUNICATE WITH THE SELLER FOR ANY PRE-ORDER,ORDER AND ETC.

3,7

599 beoordelingen

5
267
4
94
3
104
2
31
1
103

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen