Preview

Pt1420 Assignment

Satisfactory Essays
Open Document
Open Document
1058 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Pt1420 Assignment
Short Answer
1) Why should you indent the statements in the body of a loop?
Because by indenting the statements in the body of the loop you visually set them apart from the surrounding code. This makes your program easier to read and debug
2) Describe the difference between pretest loops and posttest loops
A pretest loop means to test its condition before performing an iteration
A posttest loop means it performs an iteration before testing its condition
3) What is a condition-controlled loop?
A condition-controlled loop uses a true/false condition to control the number of times that it repeats
4) What is a count-controlled loop?
A count-controlled loop repeats a specific number of times
5) What three actions do count-controlled loops typically perform using the counter variable?
1) Initialization: the variable is initialized 2) Test: the loop tests the variable by comparing it to the maximum value 3) Increment: to increase the value during each iteration the loop increments the counter variable by adding 1 to it.

Algorithm Workbench Review Question
1) Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should iterate as long as the product contains a value less than 100.
Declare product as integer
Declare number as integer
While product < 100
Display “What is your number”
Input number
Product = number *10
Display “Your number is “, product
End While
2) Design a Do-While loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user if he or she wishes to perform the operation again. If so, the loop should repeat, otherwise it should terminate
Declare string again
Declare 1num as Real
Declare 2num as Real
Declare sumNum as real

Do Display “What is your first number” Input 1num = “” Display “What is your second number” Input 2num = “” sumNum = 1num+2num

You May Also Find These Documents Helpful

  • Satisfactory Essays

    PT1420 Chapter 3 Review

    • 1062 Words
    • 8 Pages

    4. Assume the variables result, w, x, y, and z are all integers, and that w = 5, x = 4, y = 8, and z = 2. What value will be stored in result in each of the following statements?…

    • 1062 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1330 Unit 2 Assignment 1

    • 3740 Words
    • 15 Pages

    1. A while loop will not execute the body of the code if you have your test condition incorrect.…

    • 3740 Words
    • 15 Pages
    Satisfactory Essays
  • Satisfactory Essays

    2.What number does a bit that is turned on represent? What number does a bit that is turned off represent? On is 1 and Off is 2…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Pt1420 Unit 3 Assignment

    • 2806 Words
    • 12 Pages

    Essential Standards Portfolio Assignment The Essential Standards and Mathematical Terms you will be using in this Unit are in blue text below. Essential Standards Mathematical Terms Graphing a Polynomial Function, Finding Zeroes/Solutions to a Polynomial Polynomial Functions Function Center and Vertices, Foci, Major and Minor Axes, Standard Equation for an Conic Sections - Ellipse Ellipse Center and Vertices, Foci, Transverse and Conic Sections Conjugate Axes, Asymptotes, Standard Hyperbola Equation for a Hyperbola Solving a Rational Expression Using Exponents, Solving a Rational Expression Rational Functions from a Graph Binomial Theorem Expansion Binomial Theorem Combinations and Combinations, Permutation Permutations Points 3 The…

    • 2806 Words
    • 12 Pages
    Good Essays
  • Powerful Essays

    Pt1420 Unit 3 Assignment

    • 3509 Words
    • 15 Pages

    As a developer I was involved in collecting the requirements from business end user, according understood the business needs and involved in designing the universe for sales department ,As a first step we understand the structure of the universe and depending upon the fact tables n dimension tables created classes ,objects ,defined joins ,cardinalities ,created derived tables, custom Hierarchies .…

    • 3509 Words
    • 15 Pages
    Powerful Essays
  • Good Essays

    ops335 lab 2 firewall

    • 695 Words
    • 4 Pages

    4. Enter the list price of the book and include a dollar sign in the prompt. Make the list price a decimal data type or test to ensure that the user entered a numerical value.…

    • 695 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Pt1420 Unit 4 Assignment

    • 377 Words
    • 2 Pages

    1. Name(s) of nation, major islands/island groups, capital - indigenous as well as colonial names.…

    • 377 Words
    • 2 Pages
    Good Essays
  • Good Essays

    unit 8 homework

    • 793 Words
    • 5 Pages

    4. Design a loop that asks the user to enter a number. The loop should iterate 10 times and keep a running total of the numbers entered.…

    • 793 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    6. Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    This Is a Paper

    • 469 Words
    • 2 Pages

    Provide a set of values that will test the normal operation of this program segment. Defend your choices.…

    • 469 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    I Like to 1321

    • 459 Words
    • 2 Pages

    statement. Also included is a for loop (repetition statement). Pay close attention to these as you…

    • 459 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    carloe :)

    • 253 Words
    • 2 Pages

    Problem 1: Write an application that prints every integer value from 1 to 20 along with the squared value of each integer.…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Pt1420 Unit 2 Assignment

    • 1381 Words
    • 6 Pages

    Person reported she played marbles and card games with eight other siblings, also reported that she and her siblings would be outdoors most of the time, as back in her day, not everyone had a TV and her family were too poor to afford one, so therefore they would play family based games where everyone could participate. She reported that she left school after year seven to help her mother with chores and look after younger siblings. She had a lot of responsibility for a kid.…

    • 1381 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Client Server Application

    • 1121 Words
    • 5 Pages

    receive sales input from user and send the information to the server for calculation. The server…

    • 1121 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    JavaScript

    • 504 Words
    • 3 Pages

    3. Write a function that uses substring method of String object to get the 'Scr' part of the string 'JavaScript'. Also use the length property and write the length of the string 'JavaScript' and use the charAt method to get the 'S' from 'JavaScript' and write that.…

    • 504 Words
    • 3 Pages
    Satisfactory Essays