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
  • Powerful Essays

    POW 9 IMP3

    • 1192 Words
    • 5 Pages

    Create 2 formulas, one that will calculate the last number in terms of the first number and a constant increase in rate as well as the total amount of numbers. The second formula will add ass of the resulting numbers from the first formula together after the last number is calculated.…

    • 1192 Words
    • 5 Pages
    Powerful 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
  • Powerful Essays

    Pt1420 Unit 2 Assignment

    • 1379 Words
    • 6 Pages

    Pro Bono Australia News (2013). Profile: cassandra goldie | pro bono australia. [online] Retrieved from: http://www.probonoaustralia.com.au/news/2010/09/profile-cassandra-goldie [Accessed: 12 Mar 2014].…

    • 1379 Words
    • 6 Pages
    Powerful 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

    Pt1420 Assignment 1

    • 610 Words
    • 3 Pages

    What central claim is being made? (The claim is generally made in an explicit thesis statement.)The claim was that the internet is not safe because it can share your personable information easily. And allow others to look up your information.…

    • 610 Words
    • 3 Pages
    Satisfactory 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

    * The design is not robust as there are no statements for error handling and handling exceptions. To make this code more robust I would add error handling statements like the user can only enter numbers that are between 0 and 100. Also the user cannot enter any strings like winding and other data types, for other numbers and data types the system will display "invalid input. Please enter a number between 0 and 100." Also notice that it doesn't handle the case of entering 49. You need <= 49, as it is now, when you enter 49 all it will say is "how did u do?" same thing with entering 100 and for anything over 100.…

    • 469 Words
    • 2 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
  • 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

Related Topics