Hello people,
Need help with this code here.
This code suppose to print blocks of char assigned by user with certain rows and column also assigned by user.
For some reason it is giving me error and i don't understand what the problem is
Help will be greatly appreciated.
Thanks!
#include <iostream>
using namespace std;
void func1(int rows,int column,int blocks,char symbol);
void func2(int rows,int column,int blocks,char symbol);
void display ();
int main ()
{
display();
}
void func1(int &rows,int &column,int &blocks,char &symbol)
{
cout << "Please enter Char: ";
cin >> symbol;
cout<< "Please enter the number of Blocks(Please enter between 3 and 10): ";
cin >> blocks;
if (blocks < 3 || blocks > 10)
{
do
{
cout << "You entered value out of range please enter the value between 3 and 10: ";
cin >> blocks;
}
while (blocks < 3 || blocks > 10);
}
cout << "Please enter the numbe of rows: ";
cin >> rows;
if (rows < 1 || rows > 5)
{
do
{
cout << "You entered value out of range please enter the value between 1 and 5: ";
cin >> rows;
}
while (rows < 1 || rows > 5);
}
cout << "Please enter the number of columns: ";
cin >> column;
if (column < 5 || column > 50)
{
do
{
cout << "You entered value out of range please enter the value between 5 and 50: ";
cin >> column;
}
while (column < 5 || column > 50);
}
}
void func2 (int rows,int column,int blocks,char symbol)
{
for (int row = 0; row < rows; row++){
for (int block = 0; block < blocks; block++) {
for (int col = 0; col < column; col++) {
return (symbol);
}
cout<<"\t";
}
cout << endl;
}
}
void display ()
{
int rows,column,blocks;
char symbol;
func1 (rows,column,blocks,symbol);
func2 (rows,column,blocks,symbol);
}