[PHP]#include <iostream>
int main()
{
using std::cout;
using std::endl;
using std::cin;
int value, count=0, sum=0, average,total, smallest, largest;
for(;;) // i.e. loop forever .... until break
{
for(;;) // ever ...
{
cout << "Enter value " << count+1 << ":...
User Profile
Collapse
-
Hello boxfish thanks for the help, the pointers are supposed to store the value given by MPG, because each time in the loop i will assign different values for miles and gallons and i need it to store the output for each loop into a certain variable so i can average them later.
Basically im trying to reference as an elemental in my array, how do i do that. Say i want the first element in my MPG array, how do i reference it ?
... -
Pointer Question
[PHP]#include <iostream>
#include <vector>
using std::cout;
using std::cin;
using std::endl;
int main(void)
{
int x;
x=0;
while ( x < 3 )
{
int m1;
int m2;
int m3;
int a[] ={m1,m2,m3};
cout<<"Enter the Miles used (-1 to quit):" << endl;
cin>> a[x];
... -
-
Real Fast While Loop Question
[PHP]#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main(void)
{
int m1;
int g1;
int x=1;
int MPG;
m1=287,200,120;
g1=13,10,5;
while ( x <= 3 )
{
MPG= m1/g1;
cout<<" MPG this tankful:" << MPG << endl;
x++;
... -
Need classes help.
This is my header file.
[PHP]#include <string>
using std::string;
class Employee
{
public:
Employee(string ,string,int) ;
void setFirstName( string );
string getFirstName();
void setLastName( string );
string getLastName();
void setMonthlySalar y(int);
...
No activity results to display
Show More
Leave a comment: