newbee and need guidance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>

using namespace std;

   int main()
{
    int 0, 1, 2, 3;
    char Y, N, a, z, b, c, d, e, f, g, n;
    {
        cout<<¨What is your weight?: ¨;<<endl;
        cin>>n;

        cout<<¨Do you have siblings? Y for yes and N for no.: ¨;<<endl;
        cin>>a;


    if ( a == N )
        {
        cout<<¨You are the heaviest!¨;<<endl;
        return 0;
        }

    else if( a == Y )
        {
        cout<<How many sisters do you have?: ¨;<<endl;
        cin>>z;
        if( z == 0)
        cout>>¨No one cares about how many brothers you have!¨<<endl;
        break;
        }
    else if( z == 1 )
        {
        cout<<¨What is her name?: ¨;<<endl;
        cin>>b;
        cout<<¨How much does¨<< b << ¨weight?: ¨;<<endl;
        cin>>c;
        break;
        }
    else if( z == 2 )
        {
        cout<<¨What is the youngest ones name?: ¨;<<endl;
        cin>>d;
        cout<<¨What is the oldest ones name?: ¨;<<endl;
        cin>>e;
        cout<<¨What is¨ << d <<¨s height?: ¨;<<endl;
        cin>>f;
        cout<<¨What is¨ << e <<¨s height?: ¨;<<endl;
        cin>>g;
        break;
        }
    else if( z == 3 )
        {
        cout<<¨Your mom is a slut!¨;<<endl;
        return 0;
        }
    if( n > (f,g))
        {
        cout<<¨You are the heaviest!¨;<<endl;
        return 0;
        }
    else if( f > (g,n))
        {
        cout<< d << ¨is the heaviest!¨;<<endl;
        return 0;
        }
    else if( g > (n,f))
        {
        cout<< e << ¨is the heaviest!¨;<<endl;
        }
    return 0;
}

what am i doing wrong here can anyone help?? i am a beginner just started 1 week ago. i am gonna have to take the class for this semester coming up @ county college and i want a jump on the class!!
Last edited on
Could you please put your code between [code] tags?

http://www.cplusplus.com/forum/articles/16853/

Also, what is the actual problem?
i try and compile it and it comes up with a million errors! and it doesnt look like its written with the proper syntax
take a look at the code for me and tell what im doing wrong please. thanks in advance
To begin with you are using the wrong kind of quotes:

This:
 
cout<<¨What is your weight?: ¨;<<endl;

Should be like this:

 
cout<<"What is your weight?: ";<<endl;

And the same throughout.
Also what is this like supposed to do?
 
    int 0, 1, 2, 3; // ?? what is this meant to do? 
Also this:
1
2
3
4
5
6
// You should not have a semicolon in the middle of this
       cout<<"What is your weight?: ";<<endl; // wrong

// There should only be one semicolon at the end like this:
        cout << "What is your weight?: " <<endl;
well everytime i try and put the qoutes up i have to hold shift and hit the quotation button twice in a row. and it gives me those small ones. i have tried to get the big ones but im baffled!! that int 0, 1, 2, 3; thing.... i was trying to declare those variables to use throughout the program.
ok i am now conscious of the semi colon thing in the middle of my cout! i thought it went there but i guess not lol
You don't use break; in an if() statement:
1
2
3
4
5
6
7
8
    else if( a == Y )
        {
        cout<<How many sisters do you have?: ¨;<<endl;
        cin>>z;
        if( z == 0)
        cout>>¨No one cares about how many brothers you have!¨<<endl;
//        break; // remove this it is not supposed to be here
        }
basically what i was trying to do was get the users weight and ask if he/she had any sisters and store the data and see which one weighted the most! i didnt care if he/she had brothers, and it was just a program to see what i have learned so far and apparently not much lol
ok no break in if statements, gotchya!!
amboxer21 wrote:
well everytime i try and put the qoutes up i have to hold shift and hit the quotation button twice in a row. and it gives me those small ones.


Sounds like your keyboard is in international mode. Try typing a quote followed by the space bar.

amboxer21 wrote:
that int 0, 1, 2, 3; thing.... i was trying to declare those variables to use throughout the program.


Variable names can not begin with numbers, they have to begin with a letter.
When writing programs it it best to write them just a few lines at a time. Make sure those lines are correct before adding a few more.
Last edited on
well wen i try and do the qoute space trick i get this ' thing. is there a way i can shorten up on the variable declaration??
should i look at something else in the tutorial so i can clean my program up? and make it more efficient? like fnctions or pointers maybe??
and the quotation problem was because i had dead keys enabled.
Topic archived. No new replies allowed.