Desolate Carnage
 
@ Task
Archived | Views: 986 | Replies: 18 | Started 15 years, 3 months ago
 
#572035 | Wed - Jul 15 2009 - 11:26:44
Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact: Offline PM
Points: 109.60
Need to figure out how to make this a for loop not a while loop PLIZ.

CODE

#include <iostream>
#include <cstdlib>
using namespace std;

void Greeting (double);

int main()  {
   //Declerations
   double repeat;
   
   
   //Input
   cout << "Enter the numbers of times to say Hello: ";
   cin >> repeat;
   Greeting(repeat);
   
system("PAUSE");
return 0;
}
   //Process
   void Greeting (double repeat) {
        while (repeat > 0) {
            cout << "Hello" << endl;
            repeat = repeat - 1;
            }
            }
 
#572037 | Wed - Jul 15 2009 - 11:28:30
Group: Guest
Posts: 12,45510k
Joined: Mar 24 2008
Contact: Offline PM
Points: 4,371.10
7
 
#572049 | Wed - Jul 15 2009 - 12:12:56
Group: Members
Posts: 74,19840k
Joined: Oct 25 2006
Contact: Offline PM
Points: 6,883.75 $ $
m9
 
#572056 | Wed - Jul 15 2009 - 12:19:51
Group: Members
Posts: 22,70420k
Joined: Oct 22 2006
Contact: Offline PM
Points: 1,044.55
:papaya:
 
#572060 | Wed - Jul 15 2009 - 12:27:50
Group: Members
Posts: 50,46540k
Joined: Mar 29 2008
Contact: Offline PM
Points: 9,628.10 $ $
I don't understand why you made this toilet, I thought you downloaded the ilolphone app: "help me during my java test task."
 
#572061 | Wed - Jul 15 2009 - 12:28:32
Group: Members
Posts: 50,46540k
Joined: Mar 29 2008
Contact: Offline PM
Points: 9,628.10 $ $
Quote (xstakemx @ Wed - Jul 15 2009 - 13:27:50)
I don't understand why you made this toilet, I thought you downloaded the ilolphone app: "help me during my java test task."


Hey Asshole!!! Java isn't the same as JavaScript.
 
#572062 | Wed - Jul 15 2009 - 12:29:41
Group: Members
Posts: 50,46540k
Joined: Mar 29 2008
Contact: Offline PM
Points: 9,628.10 $ $
Quote (xstakemx @ Wed - Jul 15 2009 - 13:28:32)
Quote (xstakemx @ Wed - Jul 15 2009 - 13:27:50)
I don't understand why you made this toilet, I thought you downloaded the ilolphone app: "help me during my java test task."


Hey Asshole!!! Java isn't the same as JavaScript.


Guys just made cuz the languages he knows how to program in are less valid and useful than :joe: 's reproductive organs
 
#572063 | Wed - Jul 15 2009 - 12:30:28
Group: Members
Posts: 47,60340k
Joined: Sep 1 2006
Contact: Offline PM
Points: 44,538.17
Quote (xstakemx @ Wed - Jul 15 2009 - 13:28:32)
Quote (xstakemx @ Wed - Jul 15 2009 - 13:27:50)
I don't understand why you made this toilet, I thought you downloaded the ilolphone app: "help me during my java test task."


Hey Asshole!!! Java isn't the same as JavaScript.


This one? LOL

User Image
 
#572086 | Wed - Jul 15 2009 - 14:59:36
Group: Members
Posts: 74,76940k
Joined: Aug 5 2007
Contact: Offline PM
Points: 7,730.25 $
just use an if statement inside a loop?
 
#572087 | Wed - Jul 15 2009 - 15:01:57
Group: Members
Posts: 74,76940k
Joined: Aug 5 2007
Contact: Offline PM
Points: 7,730.25 $
loop
if repeat greater than 0
cout
repeat = repeat--
else exit
 
#572095 | Wed - Jul 15 2009 - 15:30:40
Group: Members
Posts: 26,99320k
Joined: Aug 30 2006
Contact: Offline PM
Points: 1,959.57
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
while (1)
{
printf("desu ");
}

return EXIT_SUCCESS;
}
 
#572216 | Wed - Jul 15 2009 - 20:55:56
Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact: Offline PM
Points: 109.60
nvm figures it out
 
#572226 | Wed - Jul 15 2009 - 21:31:24
Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact: Offline PM
Points: 109.60
Which of the following statements creates an object of the ifstream class?

1. ifstream results:
2. fstream ifstream results;
3. define results as ifstream;
4. results = ifstream;
 
#572227 | Wed - Jul 15 2009 - 21:37:59
Group: Members
Posts: 74,76940k
Joined: Aug 5 2007
Contact: Offline PM
Points: 7,730.25 $
if you typo'd number 1 to be a : instead of ;, then its number 1

ifstream results;
 
#572228 | Wed - Jul 15 2009 - 21:38:14
Group: Members
Posts: 74,76940k
Joined: Aug 5 2007
Contact: Offline PM
Points: 7,730.25 $
also, ifstreams are humongous pains in the ass, at least they were for me
 
#572231 | Wed - Jul 15 2009 - 21:42:04
Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact: Offline PM
Points: 109.60
it's a quizz
and it has a : on it
donno if type donno if its not
 
#572233 | Wed - Jul 15 2009 - 21:42:41
Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact: Offline PM
Points: 109.60
all the other answers seem weird so i might just go with number 1
 
#572235 | Wed - Jul 15 2009 - 21:54:57
Group: Members
Posts: 74,76940k
Joined: Aug 5 2007
Contact: Offline PM
Points: 7,730.25 $
well i really dotn know the answer then
i know they were defined some weird way, but dunno
 
#572236 | Wed - Jul 15 2009 - 21:55:02
Group: Members
Posts: 74,76940k
Joined: Aug 5 2007
Contact: Offline PM
Points: 7,730.25 $
try googling
Archived | Views: 986 | Replies: 18 | General Archive - 2009 Topic List
 
Quit the Internet