PLEASE I NEED THE CODE TO COMPARE WITH MINE. PLS HELP

Write a C++ program using functions that accepts a single integer value entered by the user. If the value entered is less than one, the program prints nothing. If the user enters a positive integer, n, the program prints an nn box drawn with * characters. If the users enters 1, for example, the program prints
*
If the user enters a 2, it prints
**
**
An entry of three yields
***
***
***
and so forth. If the user enters 7, it prints
*******
*******
*******
*******
*******
*******
*******
that is, a 7 X 7 box of * symbols.


Last edited on
we will not do your homework
I will

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <cctype>
using namespace std;

bool alphaCheck(char);
bool casecheck(char);

int main()
{
char character;

cout << "Please enter a character " << endl;
cin >> character;

alphaCheck(character);
if(alphaCheck)
casecheck(character);
else
cout << character << "  is not alphabetical " << endl;

if (casecheck)
cout <<  character << " is upper case " << endl;
else
cout << character << " is lower case " << end;

return 0;
}

bool alphaCheck(char character)
{
bool valid = true;
if (isalpha(character) )
valid;
else
valid = false;
return valid;
}

bool casecheck(char character)
{
bool valid = true;
if (isupper (character) )
valid;
else
valid = false;
return valid;
}
"Answer to this" doesn't seem to be the most appropriate way to ask for help. We are not working for you.

I would not have answered, and am going to report the post.
^^^^^^^^
Last edited on
Alright well you edited your post with a new problem.
I'd suggest making a new post instead.
Let's see if I can do this.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;

int main()
{
int boxsize;
cout << "Please enter an integer value for the size of box " << endl;
cin >> boxsize;

for (int i = 0; i < boxsize; i++)
{
for (int j = 0; j < boxsize; j++)
    cout << "*";
cout << endl;
}

return 0;
}
Last edited on
Topic archived. No new replies allowed.