Programming

Write a program (pseudocode) that would calculate and display the results for the multiplication table for values ranging from 1 to 100.

This what I have so far:
Declare X, Y, Z As Integer
Write “10 x 10 Multiplication Table”
For (X = 1; X<=10; X++)
For (Y = 1; Y<=10; Y++)
Set X * Y = Z
Write Z
End For(Y)
End For(X)

But I believe this would write everything on a separate line, and I need it to write in a 10x10 table manner.

  1. 👍 0
  2. 👎 1
  3. 👁 1,970
  1. Congratulations, this is an excellent pseudocode!

    There are only a few small details to attend to.

    You have already mentioned about presentation in a table form. Yes, this takes a little attention.

    Unfortunately, the physical mechanism for tabulation varies from one language to the other. However, most languages (including Java, C, C++, Visual Basic Fortran and many others) have a way to limit output to a specified number of characters, and to control whether to continue output on the same line or to skip to a new line.
    So all you have to do is to replace "Write Z" by a generic statement like:
    "Write Z in fixed format, right-justified 5 characters"
    And insert a command
    "Skip to newline"
    between End For(Y) and End For(X).
    That will take care of the presentation.

    Furthermore, if you like, you can also indicate the multiplier and multiplicand at the top and on the left to make it look like a real multiplication table. This is a little more complicated, but not difficult.

    If you like to give it a try, I will be glad to look over your pseudocode.

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. Programming

    Write a pseudocode to represent the logic of a program that allows a user to enter an hourly pay rate and hours worked. The program outputs the user's gross pay

  2. Pseudocode

    Write pseudocode for a program that calculates a customer’s total price after tax. The program will ask the user for the price of the item they are buying. Then the program will add a 5% tax to the item and output the final

  3. Programming

    Draw a flowchart or write pseudo code to represent the logic of a program that allows the user to enter values for the current year and the user’s birth year. The program outputs the age of the user this year. Preferably a

  4. Pseudocode

    Write an algorithm and pseudocode that represents a program that allows a user to enter two numbers. Your program should calculate the sum, difference (both directions), product, and quotient (both directions) of the two numbers.

  1. Fat gram calculator

    Design a program that asks the user for the number of fat grams and calories in a food item. Validate the input as follows. Make sure the number of fat grams and calories are not less than 0. According to nutritional formulas, the

  2. C++

    // Program: name of program // Author: your name // Date Written: date you began writing the program /* Abstract: Brief description of the program */ Include in-line comments in the body of your program. You can convert

  3. Pseudocode

    Write an algorithm and pseudocode for A salesperson wants to write a program to calculate their gross monthly pay based on their annual salary, total sales, and commission rate. The program's output is the monthly pay calculated

  4. CIS

    Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter a value. The program multiplies the value by 10 and outputs the result.

  1. Is My Pseudocode Correct? - Programming

    I am supposed to make a pseudocode for a fat gram calculator. These are the instructions: Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: - Make sure the number of

  2. college

    What will the following pseudocode program display? Module main( ) Declare Integer x = 1 Declare Real y = 3.4 Display x, " ", y Call changeUs(x, y) Display x, " ", y End Module Module changeUs(Integer a, Real b) { Set a = 0 Set b

  3. c programming

    a student designed a program to accept the age of an employee and then compute the employees retirement year and display the same in a statement on the screen required. a) write out the pseudo-code for the program above b) write

  4. Computer Programing & Logic Design

    Submit pseudocode and a flowchart for the following programming exercise: Test Average and Grade Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the

You can view more similar questions or ask a new question.