What's new

C & C++ C++ Student ranking system with average

IkaMusume

Forum Guru
Elite
Joined
Jan 27, 2018
Posts
1,008
Reaction
15,220
Points
1,875
Age
25
Hello po, gusto ko sana maghingi ng tulong about dito
1649341973779.png



nakuha ko naman po yung part niayn
1649342019514.png



kaso nalilito parin ako kung paano ilagay yung ranking system niya
1649342091848.png



paano po kaya ilagay ang ranking niya na ganyan na ganyan din ang itsurang output niya
eto po yung code

#include <iostream>
using namespace std;

C++:
#include <iostream>
using namespace std;

int main()
{
    int num_of_stud;

    cout << "How many students do you want to input? ";
    cin >> num_of_stud;

    int i, att[20];
    float grade[1][4], ave;
    for (i = 0; i < num_of_stud; i++)
    {
        cout << endl;
        cout << "Input Average Grade of Student #" << i + 1 << ": ";
        cout << endl;
        while (att[0] < 20)
        {
            cout << "First Grading Period: ";
            cin >> grade[0][0];

            if (grade[0][0] <= 100 && grade[0][0] > 65)
            {
                break;
            }
            else
            {
                cout << "INVALID INPUT.Input again :" << endl;
            }
        }
        while (att[1] < 20)
        {
            cout << "Second Grading Period: ";
            cin >> grade[0][1];

            if (grade[0][1] <= 100 && grade[0][1] > 65)
            {
                break;
            }
            else
            {
                cout << "INVALID INPUT.Input again :" << endl;
            }
        }
        while (att[2] < 20)
        {
            cout << "Third Grading Period: ";
            cin >> grade[0][2];

            if (grade[0][2] <= 100 && grade[0][2] > 65)
            {
                break;
            }
            else
            {
                cout << "INVALID INPUT.Input again :" << endl;
            }
        }
        while (att[3] < 20)
        {
            cout << "Fourth Grading Period: ";
            cin >> grade[0][3];

            if (grade[0][3] <= 100 && grade[0][3] > 65)
            {
                break;
            }
            else
            {
                cout << "INVALID INPUT.Input again :" << endl;
            }
        }
        ave = (grade[0][0] + grade[0][1] + grade[0][2] + grade[0][3]) / 4;

        cout << "=========================================\n";
        cout << "Average of Student #" << i + 1 << ": " << ave << endl;
        cout << "=========================================\n";
    }

    return 0;
}
1649342215194.png


eto naman ang instructions

sana po matulungan niyo ako
 
hello ulit fellow programmer hehe,

[ my own opinion lang po ]
based po sa ranking system;
gawa ka po muna ng user defined function and ilagay mo po dun sa function lahat ng computation para hindi na siksikan sa main function name since may decimal po "if statement po gagamitin" then jan na po sa function magraranking based sa output nung grades.

eto po tuts nung function sana makatulong You do not have permission to view the full content of this post. Log in or register now.
 
sadly po hindi po namin pwede gamitin ang void, sa 2nd year pa namin yun baka ma minus ako sa activity, gayunpaman po maraming salamat sa tip na 'to
hello ulit fellow programmer hehe,

[ my own opinion lang po ]
based po sa ranking system;
gawa ka po muna ng user defined function and ilagay mo po dun sa function lahat ng computation para hindi na siksikan sa main function name since may decimal po "if statement po gagamitin" then jan na po sa function magraranking based sa output nung grades.

eto po tuts nung function sana makatulong You do not have permission to view the full content of this post. Log in or register now.
 
ahh ganun po ba 1st year pa lang po kasi ako and yan na tinuturo samin now na 2nd sem
sadly po hindi po namin pwede gamitin ang void, sa 2nd year pa namin yun baka ma minus ako sa activity, gayunpaman po maraming salamat sa tip na 'to

sadly po hindi po namin pwede gamitin ang void, sa 2nd year pa namin yun baka ma minus ako sa activity, gayunpaman po maraming salamat sa tip na 'to
pero pwede namn sa main func mo nalang ilagay pero siksikan nga lang yan
 
1st year lang din po ako, nahihirapan lang ako paano yung last part yung ranking system

ahh ganun po ba 1st year pa lang po kasi ako and yan na tinuturo samin now na 2nd sem



pero pwede namn sa main func mo nalang ilagay pero siksikan nga lang yan
 
I appreciate your efforts since you are a beginner. ..Try this one.
1. Get grades data
1649347654703.png

2. Sort the 2nd array (descending order - from highest to lowest) that contains the data for the average grade. The purpose of sorting the 2nd array is to determine the rank based on position from highest to lowest
Note: the 1st array is used to reference student #.
1649347833383.png


3. Show rank by displaying the sorted average(2nd array) and look for its original position in the 1st array.
1649348082746.png


Note: Use precision for 2 decimals, setW(), Left(),Right() to position string properly. Kayang kaya mo na yan.
Good luck! Sana maimprove lalo skills mo. Keep coding...

By the way, pictures yan para ikaw mismo magtype para masundan mo logic. Hope you understand...
 

Attachments

I appreciate your efforts since you are a beginner. ..Try this one.
1. Get grades data
View attachment 1888781
2. Sort the 2nd array (descending order - from highest to lowest) that contains the data for the average grade. The purpose of sorting the 2nd array is to determine the rank based on position from highest to lowest
Note: the 1st array is used to reference student #.
View attachment 1888787

3. Show rank by displaying the sorted average(2nd array) and look for its original position in the 1st array.
View attachment 1888792

Note: Use precision for 2 decimals, setW(), Left(),Right() to position string properly. Kayang kaya mo na yan.
Good luck! Sana maimprove lalo skills mo. Keep coding...

By the way, pictures yan para ikaw mismo magtype para masundan mo logic. Hope you understand...
Oh my god! Thank you very much poooooo try ko po pag-aral yung mga codes, hindi po sayang effort niyo sa pagtuturo. Thank you po ulit
 
I appreciate your efforts since you are a beginner. ..Try this one.
1. Get grades data
View attachment 1888781
2. Sort the 2nd array (descending order - from highest to lowest) that contains the data for the average grade. The purpose of sorting the 2nd array is to determine the rank based on position from highest to lowest
Note: the 1st array is used to reference student #.
View attachment 1888787

3. Show rank by displaying the sorted average(2nd array) and look for its original position in the 1st array.
View attachment 1888792

Note: Use precision for 2 decimals, setW(), Left(),Right() to position string properly. Kayang kaya mo na yan.
Good luck! Sana maimprove lalo skills mo. Keep coding...

By the way, pictures yan para ikaw mismo magtype para masundan mo logic. Hope you understand...
1649390338653.png

THANK YOU VERY MUCH POOOO
 

Attachments

Similar threads

Back
Top