pls answer ASAP

Pages: 12
I am a really begginer in C++ and i need some help.
Here is the Execise:
Write a Function "uhrzeit". As parameters there should be given: Stunde, Minute and Sekunde.This tezt should be given in the dos shell:
Es ist <Stunde>:<Minute>:<Sekunde> Uhr.
It says also to create a call (erstelle einene aufruf) in the main function.

i made this but it doesnt work:

#include <iostream>

using namespace std;

void uhrzeit (int Stunde, int Minute, int Sekunde)
{
int zeit = 0;
cout << "Es ist" << Stunde << Minute << Sekunde << "Uhr." << endl;
return 0;
}




pls appply quick
What??
can no one onswer this????
closed account (z05DSL3A)
You only left it 11 minutes before moaning about no-one answering...

Try putting a main() function in your code.
It says also to create a call (erstelle einene aufruf) in the main function.


P.S. use [code] [/code] tags to post code.
Last edited on
lol
i really needed an answer quickly'
you mean like this:

1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;
int main()

void uhrzeit (int Stunde, int Minute, int Sekunde)
{
    cout << "Es ist" << Stunde << Minute << Sekunde << "Uhr." << endl;
}



it still doesnt work
Last edited on
pls reply
Have you ever written a c++ program?
They all have to have main() function. that means
1
2
3
4
int main(){
    //do stuff
    return 0;
}
no i never did
i am a really begginer
i still cant do it:
i wrote:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

using namespace std;


int main()
{
    void uhrzeit (int Stunde, int Minute, int Sekunde)
    {

        cout << "Es ist" << Stunde << Minute << Sekunde << "Uhr." << endl;
    }
    return 0;
}

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

using namespace std;


void uhrzeit (int Stunde, int Minute, int Sekunde)
{
    cout << "Es ist" <<" "<< Stunde <<" "<< Minute <<" "<< Sekunde <<" "<< "Uhr." << endl;
}

int main()
{
    int Stunde;
    int Minute;
    int Sekunde;

    uhrzeit(Stunde,Minute,Sekunde);
}

This works but how can i get letters in place of some numbers
closed account (z05DSL3A)
http://www.cplusplus.com/doc/tutorial/

How To: Ask Questions The Smart Way
http://www.cplusplus.com/articles/how_to_ask/
lol
i read these but i cant understand them very good.
if someone is willing to help me pls do it
Id help but im not sure what you want this program to do?
you want stunde minute and seunde to be any particular number?
also what program are you using to compile this?
Do you speak german??
I need to get this sentence as a result:

Es ist <Stunde>:<Minute>:<Sekunde> Uhr.

no i dont speak german
when i run ur program it gives me some weird numbers for stunde minute and sekunde
#include <iostream>

using namespace std;


void uhrzeit (int Stunde, int Minute, int Sekunde)
{
cout << "Es ist" <<" "<< Stunde <<" "<< Minute <<" "<< Sekunde <<" "<< "Uhr." << endl;
system("pause");
}

int main()
{
int Stunde;
int Minute;
int Sekunde;

uhrzeit(Stunde,Minute,Sekunde);
}

try running this if ur using dev c++, if ur window opens and closes
also if you want to change Stunde, Minute or Sekunde value all you do is this

#include <iostream>

using namespace std;


void uhrzeit (int Stunde, int Minute, int Sekunde)
{
cout << "Es ist" <<" "<< Stunde <<" "<< Minute <<" "<< Sekunde <<" "<< "Uhr." << endl;
system("pause");
}

int main()
{
int Stunde = 10;
int Minute = 15;
int Sekunde =55;

uhrzeit(Stunde,Minute,Sekunde);
}
thnx a lot dude
I for one am really curious as to why this keeps happening at this site. People who don't seem to have ever taken a C++ class or read past the first few chapters of a book all of a sudden need the simplest things done in 11 mins.
computergeek01++ (02?)
So with you on that one.
Maybe he's studying management???
Hey Computergeek01,
I am sure that you werent born a computer specialist and I am 16 and I just started learning basics of Programming. And it would be better if oyu help like the others do and not write such stoff.
Thanks to everyone for the support!
Pages: 12