CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Posts
    1

    Help with built in counter

    Hello All,
    I am working on an assignment that requires me to write Pseudocode for a program that does the following:

    The user is prompted to enter an integer between 1 and 1000. When the user enters the integer, the program uses a repetition control structure to validate the integer is within the proper range; otherwise, the prompt is continuously redisplayed to the user until an integer in the proper range is entered.
    I am having a difficult time understanding the meaning of the words used in Pseudocode so I am sure there are problems with what I have done so far. Any help would be greatly appreciated.

    Main Module

    Declare X as Integer
    Declare Count as Integer
    Write “This program displays the next five integers with of same parity for your number.”
    Call Input Module
    Call Count Module

    End Main Module

    Input Module

    Repeat
    Write “Enter a number from 1 to 1000.”
    Write “The minimum number is 1 and the Maximum is 1000”
    Input = X
    Until X >= 1 and X<= 1000

    End Input Module

    Count Module

    Set Count = X
    For Counter = X Step 2 To 5
    Write “Here are the next five numbers of the same parity” Count, Count + 2

    End for

    End Count Module

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: Help with built in counter

    Looks okay to me.
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured