Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need Urgent Help!

Hello,
New to this forum and the world of programming, first year student pursuing my Bsc, just got into structured programming and I'm in a bit of trouble, the first assignment requires us to write a program that accepts 6 inputs, display them from lowest to highest, calculate the avg scores and determine the perfomance of the students (Excellent, Poor, etc). To be quite honest I'm a bit hung up on how to begin, I am not asking for someone to do my homework, but any assistance will be greatly appreciated.

Comments

  • cbtsamcbtsam Member Posts: 2
    //Program name : test086.c
    //WAP to calculate and print Mark Sheet
    # include
    # include
    void main()
    {
    int m1,m2,m3,m4,m5,m6,totalmark;
    float perc;
    char status;
    clrscr();
    printf("Enter SIX Subject Marks Separated by Space : ");
    scanf("%d %d %d %d %d %d",&m1,&m2,&m3,&m4,&m5,&m6);

    totalmark=m1+m2+m3+m4+m5+m6;
    perc=totalmark/6;
    printf("Total Mark = %d Percantage = %f
    ",totalmark,perc);

    if (m1>=35 && m2>=35 && m3>=35 && m4>=35 && m5>=35 && m6>=35)
    {
    status='p';
    printf("Status = Pass
    ");
    printf("Grade = ");
    if (perc>=75)
    printf("Dist");
    if (perc>=60 && perc<75)
    printf("First class");
    if (perc>=45 && perc<60)
    printf("Second Class");
    if (perc<45)
    printf("Pass Class");
    }
    else
    {
    status='f';
    printf("Status = Fail
    ");
    printf("Grade = Please try again, Better Luck next time.");
    }
    getch();
    }

    [b]Output:[/b]
    Enter SIX Subject Marks Separated by Spaces : 60 70 80 90 80 70
    Total Marks = 450 Percantage = 75.000000
    Status = Pass
    Grade = Dist.

    Enter SIX Subject Marks Separated by Spaces : 50 40 30 60 50 30
    Total Marks = 260 Percantage = 43.000000
    Status = Fail
    Grade = Please try again, Better Luck next time.

    Hi friends here is the link for free c, c++, c# and java tutorials.
    It offers online Let Me Try Compiler for C, C++, C#, JAVA, CSS, HTML, JavaScript.
    http://www.cbtsam.com/cl1/cbtsam-cl1-080.php

  • cbtsamcbtsam Member Posts: 2
    //Program name : test086.c
    //WAP to calculate and print Mark Sheet
    # include
    # include
    void main()
    {
    int m1,m2,m3,m4,m5,m6,totalmark;
    float perc;
    char status;
    clrscr();
    printf("Enter SIX Subject Marks Separated by Space : ");
    scanf("%d %d %d %d %d %d",&m1,&m2,&m3,&m4,&m5,&m6);

    totalmark=m1+m2+m3+m4+m5+m6;
    perc=totalmark/6;
    printf("Total Mark = %d Percantage = %f
    ",totalmark,perc);

    if (m1>=35 && m2>=35 && m3>=35 && m4>=35 && m5>=35 && m6>=35)
    {
    status='p';
    printf("Status = Pass
    ");
    printf("Grade = ");
    if (perc>=75)
    printf("Dist");
    if (perc>=60 && perc<75)
    printf("First class");
    if (perc>=45 && perc<60)
    printf("Second Class");
    if (perc<45)
    printf("Pass Class");
    }
    else
    {
    status='f';
    printf("Status = Fail
    ");
    printf("Grade = Please try again, Better Luck next time.");
    }
    getch();
    }

    [b]Output:[/b]
    Enter SIX Subject Marks Separated by Spaces : 60 70 80 90 80 70
    Total Marks = 450 Percantage = 75.000000
    Status = Pass
    Grade = Dist.

    Enter SIX Subject Marks Separated by Spaces : 50 40 30 60 50 30
    Total Marks = 260 Percantage = 43.000000
    Status = Fail
    Grade = Please try again, Better Luck next time.

    Hi friends here is the link for free c, c++, c# and java tutorials.
    It offers online Let Me Try Compiler for C, C++, C#, JAVA, CSS, HTML, JavaScript.
    http://www.cbtsam.com/cl1/cbtsam-cl1-080.php

  • KeronLewisKeronLewis Member Posts: 2
    Thanks bro, but I ended up figuring out by brute force, reading and understanding can be a hell of a thing. I used an array to store the values, a bubble sort function to sort the values and an if statement to print the grade rating. It turned out to be pretty simple.
Sign In or Register to comment.