Answer to Question #260488 in C++ for Jacob

Question #260488

Make a loopable menu with the following options:

-Programs 1

-Programs 2

-Exit


The first menu must contain the following programs:

  1. Print the letter "W" with the symbol "*" starting in coordinates 1,1
  2. Print the letters "XX" with the symbol "*" starting in coordinate 1,1
  3. Same program as point 4 (printing squares) but without filling the inside with *'s
  4. Exit

The second menu must contain the following programs:

  1. Ask two different numbers, print the multiplication tables ranging from those numbers, for example if the numbers given are 2 and 4, print the multiplication tables for 2, 3 and 4.
  2. Ask a number and sum the consecutive numbers until the number asked, for example if the number given is 3, the program should print the result of 1+2+3
  3. Print 4 squares with the symbol "*" which have a size of 10, 5. Print them in the following coordinates. Square 1: 5,5 Square 2: 5,15 Square 3: 30,5 Square 4: 30,15, this program must contain loops.
1
Expert's answer
2021-11-03T08:33:25-0400
#include <iostream>


using namespace std;


int main()
{
    while (true){
        int c;
        cout<<"\n1. Program 1 \n2. Program 2\n3. Exit";
        cout<<"\nEnter your choice: ";
        cin>>c;
        
        if(c==1){
            int c2;
            cout<<"\n1. Print the letter 'W' with the symbol '*' starting in coordinates 1,1";
            cout<<"\n2. Print the letters 'XX' with the symbol '*' starting in coordinate 1,1";
            cout<<"\n3. Same program as point 4 (printing squares) but without filling the inside with *'s";
            cout<<"\n4. Exit";
            cout<<"\nEnter your choice: ";
            cin>>c2;
            if (c==1){
                
            }
            else if (c==2){
                
            }
            else if(c==3){
                
            }
            else if (c==4){
                break;
            }
        }
        else if(c==2){
            int c3;
            cout<<"\n1. Multiplication Table";
            cout<<"\n2. Sum consecutive numbers";
            cout<<"\n3. Print squares";
            cout<<"\n4. Exit";
            cout<<"\nEnter your choice: ";
            cin>>c3;
            if (c==1){
                int a,b;
                cout<<"\nEnter first number: ";
                cin>>a;
                cout<<"\nEnter second number: ";
                cin>>b;
                
                for(int i=a;i<=b;i++){
                    cout<<i<<"*"<<i<<(i*i);
                }
            }
            else if (c==2){
                
            }
            else if(c==3){
                
            }
            else if (c==4){
                break;
            }
        }
        else if(c==3){
            break;
        }
    }


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS