O
one.1more
Hello, somehow, the rightside part of the code got cut on most of the
lines. Can someone fill up the missing code. it should work like this
http://www.compcamps.com/camps2005/nmagnus/c++/diamond/diamond.exe
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
char charshow;
char again;
int i;
float lines;
int line;
char forh;
while(again!='n')
{
cout<<"Would you like to make a filled or hollow diamond? ";
cin>>forh;
cout<<"Input character to use: ";
cin>>charshow;
cout<<"Input the number of lines to center: ";
cin>>line;
lines=line;
line=ceil(lines/2);
cout<<"I will now generate..."< system("pause");
if(forh=='h')
{
for(i=1;i {
//spaces
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout << " ";
}
//spaces
if(i!=1)
{
cout< }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
for(i=lines;i>0;i--)
{
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout << " ";
}
if(i!=1)
{
cout< }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
}
else{
for(i=1;i {
//spaces
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout < }
//spaces
if(i!=1)
{
cout< }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
for(i=lines;i>0;i--)
{
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout < }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
}
cout<<"Would you like to do this again? (y,n): ";
cin>>again;
}
return 0;
}
lines. Can someone fill up the missing code. it should work like this
http://www.compcamps.com/camps2005/nmagnus/c++/diamond/diamond.exe
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
char charshow;
char again;
int i;
float lines;
int line;
char forh;
while(again!='n')
{
cout<<"Would you like to make a filled or hollow diamond? ";
cin>>forh;
cout<<"Input character to use: ";
cin>>charshow;
cout<<"Input the number of lines to center: ";
cin>>line;
lines=line;
line=ceil(lines/2);
cout<<"I will now generate..."< system("pause");
if(forh=='h')
{
for(i=1;i {
//spaces
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout << " ";
}
//spaces
if(i!=1)
{
cout< }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
for(i=lines;i>0;i--)
{
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout << " ";
}
if(i!=1)
{
cout< }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
}
else{
for(i=1;i {
//spaces
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout < }
//spaces
if(i!=1)
{
cout< }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
for(i=lines;i>0;i--)
{
for(int l=0;l {
cout<<" ";
}
cout< for(int j=0;j {
cout < }
for(int l=0;l {
cout<<" ";
}
cout << endl;
}
}
cout<<"Would you like to do this again? (y,n): ";
cin>>again;
}
return 0;
}