Question

This program is C++

You have just been offered your first big software contract. The scope of work is to create a tool for grade school students to learn their times tables. In this program, you will create a 10 x 10 grid of times tables as a cheat sheet for the students to learn. This will display the values of the times tables all the way from 1x1 to 10x10. Make use of formatting tools like inserting tabs, setwidth(), or other formatting to keep the columns nice and neat!


This table must be generated using multiplication and for loops. The answers must be generated from nested for loops ranging from one to ten elements. Use multiplication and the nested structure to generate the pattern.

Note: Use row for the index of the outer loop. Use col for the index of the inner loop. First get the interior of the multiplication table to print. I recommend using (row * col). Then add the labels for the rows and columns like it's shown in the picture below. A readable grid is the target.

Use a horizontal line to separate the row 1 label from the grid, and use a vertical line to separate the column 1 labels from the grid.

The rest of the grid is optional. You will earn bonus points if you include the vertical and horizontal grid lines throughout the table.

TIP: Use the Shift + \ key to create vertical lines such as

1 2 3 4 5 6 7 8 9 10 1|1|2|3|4|5|6|7|8|9|10| 2 ||4|6|8|10|12|14| 16 18 | 20| 33169 |12|15|18|21] 24| 27|30 4 |4||12|16 | 20|21 2 3 4 5 6 7 8 9 10 1 1. 21 3 41 5 6 70 80 9| 101 2 2141 6 8 10 12 14 16 18 20 3 316 9 12 15 18 21 24 27 30 4 41 8 12 16 20

1 0
Add a comment Improve this question Transcribed image text
Answer #1
#include<iostream>
#include<iomanip>
using namespace std;

int main()
{ 
    int i,j;    
    cout<<"        "<<1;            //spacing from the left most corner to the start of numbers (i.e.padding__left)
    
    for(i = 2;i <= 10;++i)
       cout<<"    "<<i;             //spacing in between the top most numbers
    
    cout<<endl;
    cout<<"      ____";             //top most border of grid
    
    for(i = 2;i <= 10;++i)
      cout<<"_____";                //top most border of grid
    
    cout<<endl;
    
    for(i = 1;i <= 10;++i)
    {
        cout<<setw(2)<<i<<"   |";           //setw(the spacing before the number to be printed)
    
        for(j = 1;j <= 10;++j)
            cout<<setw(4)<<j*i<<"|";        //Multiplying i and j for tables
    
        cout<<endl;
        cout<<"     |____";                 //for the first lower grid
    
        for(j = 2;j <= 9;++j)
            cout<<"|____";                  //Upper grid
    
        cout<<"|____|";
        cout<<endl;
    }
    return 0;
}

Hope this will help, please upvote if you benefited by this solution... it keeps us motivated to solve more problems

Add a comment
Know the answer?
Add Answer to:
This program is C++ You have just been offered your first big software contract. The scope...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • in Java programming Using IF statement, write a program that prints multiplication table for 1-10. Sample...

    in Java programming Using IF statement, write a program that prints multiplication table for 1-10. Sample Program Output. 1     2     3     4     5     6     7     8     9     10       1     1     2     3     4     5     6     7     8     9     10       2     2     4     6     8     10    12    14    16    18    20       3     3     6     9     12    15    18    21    24    27    30       4     4     8     12    16    20    24    28    32    36    40       5     5     10   ...

  • NB: All C programs should be compiled using C Compiler application. The code should be shown...

    NB: All C programs should be compiled using C Compiler application. The code should be shown on the document. A screen shot of the running program given as output on the assignment. a). Describe the types of arrays and operations that can be performed of them. [10] b). Write a program to print the multiplication table from 1*1 to 12*10. [10] Example MULTIPLICATION TABLE 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12...

  • Write a program in C that stores the result of all multiplications between 1 and 9...

    Write a program in C that stores the result of all multiplications between 1 and 9 in a two-dimensional int array and then prints the contents of the array to the screen. Also, write some comments in the code. Example: Expected output: 1 4 6 7 8 8 1 12 14 16 18 4 3 6 9 12 15 18 21 24 27 4 8 12 16 20 24 28 32 36 5 1e 15 20 25 30 35 40...

  • Write a C program to print the figure as follows. 5, Write a C program to...

    Write a C program to print the figure as follows. 5, Write a C program to print the figure as follows. 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 4 6 8 10 12 14 16 18 9 12 15 18 21 24 27 16 20 24 28 32 36 25 30 35 40 45 36 42 48 54 49 56 63 64 72 81 1 Tip: use loop.

  • Write a Python program to print a timetable. E.g. printTimesTable(n), 1<n<10 Or you can make your...

    Write a Python program to print a timetable. E.g. printTimesTable(n), 1<n<10 Or you can make your program be interactive with user by S. Asking user to input their number n. Your program will generate a table such as the following: 1 2 3456789 24 6 8 10 12 14 16 18 3 6 91215 18 21 24 27 4 812 16 20 24 28 32 36 5 10 15 20 25 30 35 40 45 6 12 18 24 30...

  • Write a Java program that uses nested for loops to print a multiplication table as shown...

    Write a Java program that uses nested for loops to print a multiplication table as shown below. Make sure to include the table headings and separators as shown. The values in the body of the table should be computed using the values in the heading e.g. row 1 column 3 is 1 times 3. * | 1 2 3 4 5 6 7 8 9 4 | 1| 1 2 3 456 7 8 9 2 | 2 4 6.8...

  • Python pleases! Write a program that will produce the following table below. You will use a...

    Python pleases! Write a program that will produce the following table below. You will use a nested for loop and a duplicate nested while loop in one program. Note that this is the one through twelve multiplication table. Write the flowchart for the program. X 1 2 3 4 5 6 7 8 9 10 11 12 1 1 2 3 4 5 6 7 8 9 10 11 12 2 2 4 6 8 10 12 14 16 18...

  • Note: The assignment must be submitted into the designated link in the Blackboard cou page. You...

    Note: The assignment must be submitted into the designated link in the Blackboard cou page. You are to save each HTML5 document file as the following synt StudentID FirstName_LastName Question Number ► QUESTIONS In this assignment you are required to write HTML5 code which contains JavaScript in order to do the following tasks: 1) Construct the below multiplication table using JavaScript code and HTML5 1 2 3 4 5 6 7 8 9 10 11 12 111 2 3 4...

  • Using Html 5: - You are to create a table consisting of 11 rows and 11...

    Using Html 5: - You are to create a table consisting of 11 rows and 11 columns. The table cells are to be 40 pixels wide, each row. The table is to also have a header row that spans across all columns and contains 'Multiplication Math' as the table name. - Alternating rows will have a different background color. - The table is to be centered in the HTML page. The top table row is to have the numbers 1-10...

  • For each variable of interest – Percent Time Asleep and Longevity – create a grouped frequency...

    For each variable of interest – Percent Time Asleep and Longevity – create a grouped frequency histogram. For each histogram, use a class width of 10; use a lower limit of 0 for Percent Time Asleep and 15 for Longevity. Each histogram must include an informative title, along with correct labels for both axes. For each histogram, include a paragraph that answers each of the following questions: Is the histogram symmetric, skewed to the left, or skewed to the right?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT