Preview

PT1420 U8 Homework

Satisfactory Essays
Open Document
Open Document
431 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
PT1420 U8 Homework
Unit 8 Homework
Short Answer:
6. a loop that never hits a max value or that never turns true is infinite
While (number >=0) Console.ReadLine(“Enter a positive number”) number = Console.ReadLine()
End While
7. A count-controlled loop
8. You need to initialize so you don’t fall into an infinite loop.
9. You can let user control the number of times it executes
10.
Algorithm Workbench:
#3:
For counter = 0 Step 1000 Console.WriteLine(“Value ” & counter) counter = counter + 10
#4:
Dim sum as integer = 0
Dim number as integer = 0
Dim counter as integer = 0
While counter < 10 Console.writeline(“enter a number”) Number = Console.Readline() Sum = sum + number Counter = counter + 1
End While
#9:
Dim count as integer = 0
For count = 0 Step 50 Console.writeline(“the count is ” & count) count = count + 1
End For
#10:
Dim count as integer = 1
While count < 50 Console.writeline(“The count is ” & count) count = count + 1
End While
Programming Exercises:
#7:
Module Module1

Sub Main() 'declare variables Dim year As Integer = 1 Dim numYears As Integer = 0 Dim month As Integer = 1 Dim rainfall As Double = 0.0 Dim totalRain As Double = 0.0 Dim totalMonths As Integer = 0 Dim avg As Double = 0.0

Console.WriteLine("Enter number of years for rainfall average") numYears = Console.ReadLine() While year <= numYears While month <= 12 Console.WriteLine("For year " & year & " and month " & month & " enter rainfall amount in inches") rainfall = Console.ReadLine() totalRain = totalRain + rainfall month = month + 1 End While month = 1 year = year + 1 End While totalMonths = numYears * 12 avg = totalRain / totalMonths

Console.WriteLine("The total number of months is " & totalMonths) Console.WriteLine("The total rainfall is " & totalRain & "

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Pt1420 Unit 3 Assignment

    • 298 Words
    • 2 Pages

    2. Consider the following two vectors: x =  1  and y =  1 .…

    • 298 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Samuel Aggor CSC 1100 3/3/16 Assignment 5 Problem 1 a. Output: 3.94 b. Output: 6.67 c. Output: 15.00 d. Output: -35.00 e. Output: 0 Problem 2 a. Output: 62 b. Output: 20160 c. Output: 20 213837312 d. Output: 1 Problem 3 a. Func1 has two parameters. Func1 is an integer function. b. Func2 has three parameters. Func2 is a double function.…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Indeed, Santa Claus is coming to town. Only this time, he's a "Secret Santa" in the form of a casino online video slot game provided by Microgaming. It's hard to imagine there would be slot players who won't enjoy playing the Secret Santa slot, even if it's only during the holiday season. Since the jackpots and excitement exist year-round, it makes perfect sense this game should be considered a keeper 365 games a year.…

    • 605 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    The free group with two generators a and b is composed of all finite strings that are formed from the four symbols a, a−1, b and b−1 given that no a is directly next to an a−1 and no b is directly next to a b−1. Two such strings can be concatenated and converted into a string of this type by repeatedly replacing the "forbidden" substrings with the empty string. For example: abab−1a−1 concatenated with abab−1a yields abab−1a−1abab−1a, which contains the substring a−1a underlined in the example, and so the “forbidden” string gets cancelled and reduced to abab−1bab−1a, which again contains the substring b−1b underlined in the example, which then gets reduced to abaab−1a. It can be checked that the group formed from the set of those strings with…

    • 493 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    No the supervisor isn't right because Mark and Jean can fill the pool less than ten hours.…

    • 104 Words
    • 1 Page
    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
  • Satisfactory Essays

    For Visual Basic a variable’s name must have a letter as the first character, you cannot use spaces, periods, or other special characters such as !@#. The name cannot exceed 255 characters. The variable should not have a similar name as the functions, statements, and methods, and the name cannot be repeated within the scope. This language is not case sensitive.…

    • 333 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 6 Programming

    • 420 Words
    • 5 Pages

    print (” These are not primary colors . I can ’ t mix them !”)…

    • 420 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    1. Explain in words why the equation {n \choose k} = {n \choose n -k} is true.…

    • 527 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 1 Assignment

    • 303 Words
    • 2 Pages

    These administrations help in building common dialect UIs. Discourse to Text gives a transcript of common dialect into content. Artificial intelligence is utilized to join linguistic and dialect structures with the preparing of voice motion for a more exact recognizable proof of words. Then again, Text to Speech benefit incorporates discourse from a content document while altering cadence and sound. The words are integrated progressively in a few dialects.…

    • 303 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Pt1420 Unit 3 Essay

    • 966 Words
    • 4 Pages

    I got the idea because my cousin and I were playing a game where you had to multitask. So that’s how I came up with the idea. I thought that the kids would be the best at multitasking because since all the kids are still in school they might know more. I conducted the experiment by first gathering my subjects and my materials. Then I explained to all of my subject what they were going to do, I started the experiment and wrote everything they did during the test. Finally wrote all the data on the data table. The result was adults were the best at…

    • 966 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Pt1420 Unit 7 Analysis

    • 737 Words
    • 3 Pages

    Each of these components is programmed in a specific language, for example, Perl, java. PHP, Python, Ruby, or Erlang. Almost every language supports web programming, Different syntax, and same semantics. Consequently, severer side developers have a tendency to solve every problem in her/his desired…

    • 737 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    week 3 worksheet BSHS 355

    • 1114 Words
    • 4 Pages

    A domestic violence program provides protection and resources to individuals treated violently by their spouses or partners. These programs can have many components. Shelters are available for individuals needing protection from violence. Additionally, some services provide resources to individuals once they leave the shelter to help them regain independence.…

    • 1114 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    Pt1420 Unit 6 Paper

    • 318 Words
    • 2 Pages

    1. The state of Florida is amongst 16 other states that selects judges through the method “appointment-retention election”. A method in which a proposing group shows names to the governor, who then makes the appointment; appointees need to win a retention vote in the next election. It is not necessarily a good system because the selection is placed in the hands of the judges or attorneys who comprise the nominating committee and the governor, with only a impression of voter input. Reorganizers argue that the plan eliminate judges from politics and saves the electorate the problem of voting on judicial candidates when they know little about their professional qualifications.…

    • 318 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Quiz For Online Class

    • 387 Words
    • 2 Pages

    Question 7.7. Which of the following is an example of a terminal value? (Points : 2)…

    • 387 Words
    • 2 Pages
    Satisfactory Essays

Related Topics