if else statment outputting 2 outputs

im making an if else statement program determining the eligibility of an applying student. my output for student - 2 keeps saying "wow!is this for real?We would love to have you at UNA... blah blah"

cout << "Hello! Please enter your student classification: " << endl;
cout << "High school graduate-1" << endl << "Transfer student-2" << endl << "Current UNA student-3" << endl;

cin >> stdntClass;

{
if (stdntClass == 1)
{
cout << "Congrats! Please enter your GPA here: ";
cin >> gpa;
cout << "And your ACT score here: ";
cin >> act;
}
if (gpa >= 3.0 || act >= 24 )
{
cout << "Wow! Is this for real?";
}
else
{
cout << "Sorry, it appears your GPA and ACT scores do not meet UNA requirements.";
}
}
{
if (stdntClass == 2)
{
cout << "We would love to have you here at UNA! please enter your current GPA here: ";
cin >> gpa;
}
if (gpa >= 3.0)
{
cout << "Wow! is this for real?";
}
else
{
cout << "Sorry, it appears your GPA does not meet UNA requirements.";
It is supposed to output "WE would love to have you... GPA here: "
I can't figure out where I went wrong.
PLEASE learn to use code tags, they make reading and commenting on source code MUCH easier.

http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/

HINT: you can edit your post and add code tags.

Some formatting & indentation would not hurt either

Posting ALL of your code as a Short, Self Contained, Correct (Compilable), Example (http://www.sscce.org/) sure wouldn't hurt either. Without code tags or more code it is hard to say what the problems might be.
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
#include <iostream>

using namespace std;

int main()
{
    int studentClass{0};
    double gpa{0}, act{0};
    
    cout
    << "Hello! Please enter your student classification:\n"
    << " High school graduate-1\n"
    << "     Transfer student-2\n"
    << "  Current UNA student-3\n";
    
    cin >> studentClass;
    
    
    if (studentClass == 1)
    {
        cout << "Congrats! Please enter your GPA here: ";
        cin >> gpa;
        cout << "And your ACT score here: ";
        cin >> act;
    }
    
    
    if (gpa >= 3.0 || act >= 24 )
    {
        cout << "Wow! Is this for real?";
    }
    else
    {
        cout << "Sorry, it appears your GPA and ACT scores do not meet UNA requirements.";
    }
    
    
    if (studentClass == 2)
    {
        cout << "We would love to have you here at UNA! please enter your current GPA here: ";
        cin >> gpa;
    }
    
    
    if (gpa >= 3.0)
    {
        cout << "Wow! is this for real?";
    }
    else
    {
        cout << "Sorry, it appears your GPA does not meet UNA requirements.";
        
    }
    
    return 0;
}


@OP
I tidied up your code and made it a complete program. With all due respect, it presents as a logical mess. The if ... else statements don't appear to make sense. No amount of guessing and quick fixing will achieve much if anything for you.

However, as a starting tip my guess is you should be asking the user for the course, gpa and act only once. Maybe also the approval/rejection decision only depends on the gpa and act?

What you need to do is:
1. Post the original question.
2. Write some pseudocode and then and only then ...
3. Write/debug code based on that.
Topic archived. No new replies allowed.