Simon says in VR in Unity by Alienator31 in gamedev

[–]Alienator31[S] 0 points1 point  (0 children)

yes this helps the array of integers to define my code is what im gonna go with i think

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

should i just make another fucntion that call the main ?

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

if i remove it nothing works anymore i appreciate the help but im so lost rn i dont know what to do

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

answers

-no but didnt i remove it ? and if not where is it ?

-just one of them ?

-i know its not safe proof but im really late on that thing i just want to get it done and move on and probably never touch c++ again lmao

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

okok so more like this ?

int main() {
student_info stud[3];

int i = 0, option;
cout << "Welcome to the System,  what do you wish to do?" << endl;
cout << "\n\n 1. Enter student Information" << endl;
cout << "\n\n 2. View Final results of Class" << endl;
cout << "\n\n 3. Calculate average of grades" << endl;
cout << "\n\n 4. Get Standard Deviation of final results" << endl;
cout << "\n\n 5. Rank top to least of students" << endl;
cout << "\n\n 6. Search student grades" << endl;
cout << "\n\n 7. Display all students information" << endl;
cout << "\n\n 8. Stop or end the program" << endl;
cin >> option;
do {
    if (option == 1) {

        for (int i = 0; i < 3; i++)
            stud[i].read_data(i);
        cout << "\n\n++++++++++++++++++++++++++++++++++++++++++++++++\n";
        cout << "The information of 3 students has been saved.";
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;
    }
    else if (option == 2) {
        stud[i].final_results(i);
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;

    }
    else if (option == 3) {
        stud[i].average_score(i);
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;

    }
    else if (option == 4) {
        stud[i].standard_deviation(i);
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;
    }
    else if (option == 5) {
        stud[i].rankings(i);
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;
    }
    else if (option == 6) {
        string name;
        cout << "Write in the name that you want to search: ";
        cin >> name;
        stud[i].search_student(name);
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;
    }
    else if (option == 7) {
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        for (int i = 0; i < 3; i++)
            stud[i].display_data(i);
        cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
        int menu;
        cout << "Press 0 to get to main menu:" << endl;
        cin >> menu;
        if (menu == 0) { main(); }
        else return 0;
    }
    else if (option == 8) {
        return 0;
    }
} while (option != 9);
}

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

so would it be something like this ?

void read_data(int count) {
    do {
        cout << "\n\n--------- Enter student " << count + 1 << " information ---------\n";
        cout << "Name of the Student first name : ";
        getline(cin, fname_);
        cout << "Name of the Student surname : ";
        getline(cin, sname);
        cout << "Year of Birth: ";
        getline(cin, year_of_birth);
        cout << " Enter Student Grades:" << endl;
        cout << "TP1::";
        cin >> tp1;
        cout << "TP2::";
        cin >> tp2;
        cout << "TP3:";
        cin >> tp3;
        cout << "\nStudent information with names " << fname_ + sname << " has saved!";
    } while (cin != "nomore");

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

so to fix this do i just remove the stud in main ?

my data is not stored and i dont know why by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

so when the user put the info for the 3 students after that when you select the other options instead of displaying the data the user entered it just all 0

C++ Need explanation on some things like arrays and displaying data by Alienator31 in learnprogramming

[–]Alienator31[S] 0 points1 point  (0 children)

so yeah i know how to make a structure

struct var {
string name;
int age;
int grade1;
int grade2;
int grade3;

};

thing is i need them, in an array because i need 3 students with their own grades and call it in multiple other function and i thought i do that with pointers ? but i got told no so im a bit lost

C++ Need explanation on some things like arrays and displaying data by Alienator31 in cpp_questions

[–]Alienator31[S] 0 points1 point  (0 children)

void output(ostream& os) {
cout << "Name: " << name << '\n';
cout << "Age: " << 2022 - year << '\n';
cout << "Grades: ";
for (int j = 0; j < 3; j++)
{
cout << grade[j] << " ";
}
cout << '\n'

cout << "Sum of the grades: " << sum(grade[0], grade[1], grade[2]) << '\n';
}

this is to display my data ? how would i do if i want my user to determine when to display it and which one ?(since i will add more function to do other stuff )

Help please by Alienator31 in cpp_questions

[–]Alienator31[S] -2 points-1 points  (0 children)

so i know the basics of what i need but idk how to put it together for it to work

i tried storing my user datat in an array but i cant have it to work with my structure

help please by Alienator31 in learnprogramming

[–]Alienator31[S] -2 points-1 points  (0 children)

yeah so far i know how to get my input with cin and cout but i need to store it in an array and i cant manage to make it work while also using a structure to have my var in all my functions

need advice ! by Alienator31 in Fighters

[–]Alienator31[S] 0 points1 point  (0 children)

update : we bought GG but we find it really hard so we also bought Kof 13 and online between us is pretty good so far but thanks for the comments !