Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Pseudocode

pseudocode

  • Please log in to reply
7 replies to this topic

#1 Japp

Japp

    CC Newcomer

  • Member
  • PipPip
  • 16 posts

Posted 19 February 2012 - 09:09 AM

Any tips on how to write pseudocode, just how to start would be helpful No C or visual python just pseudocode. I guess their is a difference. Help


Provide your analysis for the following problem statement: You need to write a program that would calculate the results for the multiplication table up from 1 to 100. (For example, 1X1, 1X2, 1X3 … 1X10, 2X1, 2X2 …. 10X2 … 10x10). Your program should print the output for each step and output a new line after 10 items. So the example output would be something like this Notice a new line appears after 10 steps:

1 2 3 4 5 6 7 8 9 10

2 4 6 8 10 … 20



10 20 30 … 100

To write the new lines you can just use code similar to : write “new line”. Hint: You will probably use a nested repetition loop.

Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe any necessary formulas and sample calculations.

2. Provide your program design for the program you analyzed for printing the multiplication table. Be sure to describe the fundamental tasks (i.e., things your program must do) needed to solve the problem so you can use a modular design. Provide pseudocode of your overall design that includes the Main module and the order of the module calls, and a Hierarchy chart for the program . Finally, display the flow charts for each module. (FLOW CHARTS I CAN DO)

Include header and step comments in your pseudocode,
3. Prepare any input data (Test data) along with expected output for testing your program (Note: Programs may not always have both input and output data. Just provide test cases for your application). Your test data can be presented in the form of a table .

This is what I have but my prof want to know where is the rest. Im stumped. Please help.


for i is 1 to 10
for j is 1 to 10
write i * j + " "
next j
write new line

next, Im lost

Edited by Japp, 19 February 2012 - 01:04 PM.
add info

  • 0

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 19 February 2012 - 05:09 PM

The only thing I'd add is "next i"

One issue with "real" pseudocode vs "learning" pseudocode is the level of detail required. What you have would work for "real". Your professor is looking for thought process, maybe a little more detail.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 Japp

Japp

    CC Newcomer

  • Member
  • PipPip
  • 16 posts

Posted 19 February 2012 - 09:01 PM

So if its 1 to 100 would it look like this. There's got to be more.
for i is 1 to 10
for j is 1 to 10
write i * j + " "
next j
write new line

for i is 2 to 20
for j is 2 to 20
write i * j + " "
next j
write new line

for i is 3 to 30
for j is 3 to 30
write i * j + " "
next j
write new line
for i is 4 to 40
for j is 4 to 40
write i * j + " "
next j
write new line

for i is 5 to 50
for j is 5 to 50
write i * j + " "
next j
write new line

for i is 6 to 60
for j is 6 to 60
write i * j + " "
next j
write new line

for i is 7 to 70
for j is 7 to 70
write i * j + " "
next j
write new line

for i is 8 to 80
for j is 8 to 80
write i * j + " "
next j
write new line

for i is 9 to 90
for j is 9 to 90
write i * j + " "
next j
write new line

for i is 10 to 100
for j is 10 to 100
write i * j + " "
next j
write new line

---------- Post added 02-20-2012 at 12:01 AM ---------- Previous post was 02-19-2012 at 10:52 PM ----------

For my pass do my numbers change ie
for i is 1 to 10
for j is 1 to 10
write i * j + " "
next j
write new line

for i is 2 to 20
for j is 1 to 10
write i * j + " "
next j
write new line

for i is 3 to 30
for j is 1 to 10
write i * j + " "
next j
write new line

What does the j numeric value become or do it stay 1 to 10?
  • 0

#4 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 20 February 2012 - 08:45 AM

No!

for i is 1 to 10
for j is 1 to 10
write i * j + " "
next j
write new line
next i
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#5 Japp

Japp

    CC Newcomer

  • Member
  • PipPip
  • 16 posts

Posted 21 February 2012 - 02:06 PM

OK
for i is 1 to 10
// inner loop
for j is 1 to 10
// outer loop
write i * j + " "
next j
write new line
next i

for i is 2 to 20
for j is 1 to 10
write i * j + " "
next j
write new line
  • 0

#6 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 21 February 2012 - 04:29 PM

Why are you doing for "i is 2 to 20"?
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#7 Japp

Japp

    CC Newcomer

  • Member
  • PipPip
  • 16 posts

Posted 23 February 2012 - 11:02 AM

Hardheaded I guess. I get it 1-10 will take of all the numbers

Din't understand the question about for and to. This isn't correct pseudocode?
  • 0

#8 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 23 February 2012 - 01:41 PM

This will create your entire table:

for i is 1 to 10
// inner loop
for j is 1 to 10
// outer loop
write i * j + " "
next j
write new line
next i

Adding anything else makes no sense.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/






Also tagged with one or more of these keywords: pseudocode

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download