Preview

Lab Assignment: Pseudocode

Satisfactory Essays
Open Document
Open Document
651 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Lab Assignment: Pseudocode
IT104 - Unit 7 Homework and Lab Assignment

Unit 7 Homework (from Ch 5)
1.) Describe the difference between pretest loops and posttest loops.
2.) What is a conditioned-controlled loop.
3.) What is a count-controlled loop.
4.) What is an infinite loop. Write the code for an infinite loop.
5.) 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 stop once product contains a value > 100.
6.) Design a For loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50,……..100
7.) Convert the following While loop in the following code to a Do-While loop:
Declare integer x = 1
While x > 0 Display “Enter a number. (0 to quit)” Input x
End While
8.) Convert the following While loop to a For loop:
Declare integer count = 0
While count < 50 Display “The count is “, count
Set count = count + 1
End While

9.) A bug collector collects bugs every day for 7 days. Design a program that keeps a running total of the number of bugs collected during the 7 days. The loop should ask for the number of bugs collected each day, and when the loop is finished, the program should display the total number of bugs collected.

For Question 9 -- Paste you pseudo code here. DO NOT paste Visual Basic program code as your design solution. That will result in 10 points deducted from the homework assignment.

*****************************************************************

Unit 7 Labs

7.1) Condition-Controlled Loops.

Write the flowchart for a program that displays the numbers 1 through 7 using a condition controlled loop (While and/or Do-While loops).

Paste your flowchart here.

7.2) Condition-Controlled Loops.

Write the Visual Basic program for 7.1 above.
Paste your program code and screen shot of your program output here

7.3) Count Controlled Loops

Design a program that uses a Count Controlled Loop to produce the following:

N 10*N 100*N 1000*N

1

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Use the scenarios in the Bugusa, Inc., link located on the student website to answer the following questions.…

    • 339 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Use the scenarios in the Bugusa, Inc., link located on the student website to answer the following questions.…

    • 915 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    it the functions listed below for Exercise 2. In each case, the appropriate error message should be generated if an invalid condition occurs. For example, an error message should be generated when trying to insert an item in a given location in the list and the location is out of range, a. ArrayList(inl size): create a constructor that sets the size of the array list to the value passed in size (note that the class variable SIZE cannot be final anymore), b. int length(): create this function to determine the number of items in the list (accessor function), c. int gelSize(): create this function to determine the size of the list (accessor function), d. void clear(): create this function to remove all of the items from the list. After this operation, the length of the list is zero, e. void replace(int location, int item): create this function to replace the item in the list at the position specified by location. The item should be replaced with item. f. void insert(int location, int item): create this function to add an item to the list at the position specified by location, g. void remove(int item): create this function to delete an item from the list. All ...…

    • 714 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    PT1420 Unit 8 Lab 8

    • 365 Words
    • 2 Pages

    Step 2: Explain what you think will be displayed to the screen in Step 1. (Reference: For…

    • 365 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 7 Assignment 1

    • 261 Words
    • 2 Pages

    2. A pretest loop is a loop tests the conditions before performing the iteration. A posttest loop performs the iteration then test the condition.…

    • 261 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 week 2

    • 320 Words
    • 3 Pages

    A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent.…

    • 320 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    soltution

    • 1407 Words
    • 6 Pages

    Please note: part (c) is covered in the Powerpoints for part (a) and (b), i.e. there is no separate Powerpoint for (c).…

    • 1407 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    For parts (b)–(d), write equations or inequalities for each question. Then do the required calculations or solve the equation to find each answer.…

    • 1364 Words
    • 13 Pages
    Good Essays
  • Satisfactory Essays

    Control Flow Diagram—Main Control [pic] Control Flow Diagram—Display Menu | | |[pic] | Control Flow Diagram—Get_Int_Value | | |[pic] | Control Flow Diagram—Convert Currency | | |[pic] | Control Flow Diagram—Display_Results |[pic] | Pseudocode Example Main Module Declare currencyType as Integer Declare internationalValue as real Declare USValue as real currencyType = 1 \ Comment: set currencyType to some number less than 6 \ to drop into the Do While loop below Do While currencyType < 6 Call Display Menu \Comment: if the user selects 6 in the Display Menu \ module then the user wants to Quit. If currencyType >= 1 and currencyType 6 \ to drop into the Do While loop) Do While (currencyType < 1 OR currencyType > 6) Display "Currency conversion program" Display "Please make a selection" Display "1: Canadian Dollars" Display "2: Mexican Pesos" Display "3: English Pounds" Display "4: Japanese Yen"…

    • 389 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pre Algebra Final Exam 1

    • 1202 Words
    • 7 Pages

    3. Use the diagram below to answer the following questions. Type your answers below each question.…

    • 1202 Words
    • 7 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CTS 2437 Final Exam

    • 630 Words
    • 4 Pages

    You should provide (1) a screen shot of your solution and (2) code for your solution, copied/pasted into this document. Each problem is worth 20 points.…

    • 630 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Assignment 3 CS 113

    • 804 Words
    • 5 Pages

    For each number x input by the user the program displays (prints) “x is in the list” or…

    • 804 Words
    • 5 Pages
    Good Essays
  • Good Essays

    (This source helped me a lot to answer most of Part A, as it had all the information required).…

    • 772 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Event Driven Module

    • 18359 Words
    • 74 Pages

    • Visual Basic practice assignment: Creating a Payroll Form • Arrays • More controls: ListBox, ComboBox • Properties and Methods of objects in Visual Basic • Building a file search application: DriveListBox, DirListBox, FileListBox • Building a Menu • Debugging Visual Basic code • Error trapping ENHANCING VB APPLICATION WITH CONTROLS • Manipulating text - string functions • Visual Basic functions for dates, numbers • Using the Windows Clipboard and Screen objects • Creating Copy, Paste, Cut, Delete functions • Pictures, Graphics and Drawing controls in Visual Basic • Multimedia - incorporating sounds and pictures • Building a CD player in code FILE…

    • 18359 Words
    • 74 Pages
    Powerful Essays
  • Good Essays

    C Programms

    • 1942 Words
    • 8 Pages

    1. Program to print text 2.Program To Read Two Numbers And Print The Sum Of Given Two Numbers. 3.Program To Accept Student Roll No, Marks in 3 Subjects and Calculate Total, Average and Print it. 4.Program To Read Three Numbers And Print The Biggest Of Given Three Numbers 5.Program To Read A Number And Find Whether The Given Number Is Even Or Odd. 6.Program to accept a year and check whether the given year IS leap year or not. 7.Individual Digits 8. Program to accept a three digit number and print the sum of individual digits. 9. Program to accept a number and check the given number is Armstrong or not. 10. Program to print ODD numbers from 1 to 10 11. Program to print natural numbers from 1 to 10 in Reverse 12. Program to print sum of the natural numbers from 1 to 10. 13. Program to accept a number and print mathematical table of the given no. 14. Program to print 1 to 10 mathematical tables . 15. Program to print fibonacci series . 16. Program to print numeric pyramid 17. Program to print numerical pyramid. 18. Program to print numerical diamond. 19. Program to print character pyramid. 20. Program to print character diamond. 21. Program to find biggest of two no by using ternary numbers 22. Program to find biggest of four no by using ternary numbers 23. Program to print smallest of four no by using ternary operators 24. Program to accept a year and check the given year is leap or not by using ternary 25. Program to accept a character in the uppercase and print in lower case. 26. Program to accept a character in any case and print in another case. 27. Program to natural number from 1 to 10 by using while loop. 28. Program to accept a string and print it by using the while loop. 29. Program to accept a string in upper case and print it by lower case. 30. Program to accept a string in any case and print it by another case . 31. Program to accept a string print each word in new line. 32. Program to accept a string and count no of capital letters, no. of…

    • 1942 Words
    • 8 Pages
    Good Essays