| | |
help with first and second problem
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 13
Reputation:
Solved Threads: 0
hi guys i ask for help but know one responded, so i figured i will ask again.
this is the first problem and why i can't print out a rectangle, triangle and diamond. i need know what am i doing wrong with both of these questions.
someone please help me.
#include <iostream>
#include "stdafx.h"
void DoRectangle();
int main()
{
void DoRectangle();
int height, width, i;
char symbol;
char response;
int shape;
cout<< " Do you wish to create a shape?:";
cin>> response;
cout<< " Enter 'Y' for yes, and 'N' for no:";
cout<<" enter a shape to create:";
cin>> shape;
cout<<" Enter rectangle width:";
cin>> width;
cout<< "Enter rectangle height:";
cin>> height;
cout<<" enter any character to be displayed:";
cin>> symbol;
for( i=1, i<=height, i++)
{
cout<<i;
}
return (0);
}
for the second problem this is what i have. what am i doing wrong
this is an ARRAY problem.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int num;
int avg;
int num;
int testscore1, testscore2, testscore3;
const int SIZE =3;
char terminate;
cout<<"enter testscore1:";
cin>> num;
cout<<" enter testscore2:";
cin>> num[82.2];
cout<<"enter testscore3:";
cin>> num[97.8];
avg = (testscore1 + testscore2 + testscore3)/3;
cout<< "the average is"<< avg << "\n";
cout<<"Enter any character to terminate:";
cin>> terminate;
return 0;
}
this is the first problem and why i can't print out a rectangle, triangle and diamond. i need know what am i doing wrong with both of these questions.
someone please help me.
#include <iostream>
#include "stdafx.h"
void DoRectangle();
int main()
{
void DoRectangle();
int height, width, i;
char symbol;
char response;
int shape;
cout<< " Do you wish to create a shape?:";
cin>> response;
cout<< " Enter 'Y' for yes, and 'N' for no:";
cout<<" enter a shape to create:";
cin>> shape;
cout<<" Enter rectangle width:";
cin>> width;
cout<< "Enter rectangle height:";
cin>> height;
cout<<" enter any character to be displayed:";
cin>> symbol;
for( i=1, i<=height, i++)
{
cout<<i;
}
return (0);
}
for the second problem this is what i have. what am i doing wrong
this is an ARRAY problem.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int num;
int avg;
int num;
int testscore1, testscore2, testscore3;
const int SIZE =3;
char terminate;
cout<<"enter testscore1:";
cin>> num;
cout<<" enter testscore2:";
cin>> num[82.2];
cout<<"enter testscore3:";
cin>> num[97.8];
avg = (testscore1 + testscore2 + testscore3)/3;
cout<< "the average is"<< avg << "\n";
cout<<"Enter any character to terminate:";
cin>> terminate;
return 0;
}
>know one responded, so i figured i will ask again
You figured wrong. Asking again is rude. Asking again in a new thread is even worse.
>why i can't print out a rectangle, triangle and diamond
The evidence suggests that you're lazy. Here's a hint: Use nested loops so that you have control over columns as well as rows.
>for the second problem
num is not an array, and array subscripts have to be integral unless you can come up with a definition of arrays where floating-point indices make sense and can sell it to ISO for standardization.
You figured wrong. Asking again is rude. Asking again in a new thread is even worse.
>why i can't print out a rectangle, triangle and diamond
The evidence suggests that you're lazy. Here's a hint: Use nested loops so that you have control over columns as well as rows.
>for the second problem
num is not an array, and array subscripts have to be integral unless you can come up with a definition of arrays where floating-point indices make sense and can sell it to ISO for standardization.
I'm here to prove you wrong.
![]() |
Similar Threads
- Problem with Windows Update and WinXP (Web Browsers)
- Installing Windows 98 On VMware. Floppy problem (Windows 95 / 98 / Me)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP)
- Redhat Linux 6.2 - ipop3d problem? (*nix Software)
- Problem with T720 (Cellphones, PDAs and Handheld Devices)
- Connection Problems (Networking Hardware Configuration)
- Encoding (Unicode) problem in IE 6.0 (Web Browsers)
- .htaccess mod_rewrite problem (Linux Servers and Apache)
- Javascript/HTML problem!!! (JavaScript / DHTML / AJAX)
Other Threads in the C++ Forum
- Previous Thread: question about array
- Next Thread: error mgs when trying to compute "for loop"
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






