please help me i need to make a program to calcutale the grade of a student with a

prelim = 20%
midterm = 20%
prelfinal = 20%
final = 40%


`        = 100 %`

Recommended Answers

All 5 Replies

What do you have so far?

(40+20+20+20)/4 = 25.

Which is probably your end score (and that's generous) if you can't even do this yourself.

#include<windows.h>
#include<iostream>
using namespace std;
void jan();
void feb();
void mar();
void april();
void may();
void jun();
void jul();
void aug();
void sep();
void oct();
void nov();
void dec();
main(){
    int m,d,y;
    cout<<" Enter your date as Day, Month and then Year. ";
    cin>>d>>m;
    switch(m){
        case 1:
            jan();
            break;
        case 2:
            feb();
            break;
        case 3:
            mar();
            break;
        case 4:
            april();
            break;
        case 5:
            may();
            break;
        case 6:
            jun();
            break;
        case 7:
            jul();
            break;
        case 8:
            aug();
            break;
        case 9:
            sep();
            break;
        case 10:
            oct();
            break;
        case 11:
            nov();
            break;
        case 12:
            dec();
            break;

    }
    system("pause");

}
void jan(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
void feb(){
    for(int i=1;i<=28;i++)
    cout<<i<<"\t";
}
void mar(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
void april(){
    for(int i=1;i<=30;i++)
    cout<<i<<"\t";
}
void may(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
void jun(){
    for(int i=1;i<=30;i++)
    cout<<i<<"\t";
}
void jul(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
void aug(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
void sep(){
    for(int i=1;i<=30;i++)
    cout<<i<<"\t";
}
void oct(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
void nov(){
    for(int i=1;i<=30;i++)
    cout<<i<<"\t";
}
void dec(){
    for(int i=1;i<=31;i++)
    cout<<i<<"\t";
}
I want the output of the program given up as 
        Saturday, 21 Jun 2014

 Please Help me!

first off , don't hijack other's thread. create your own thread.

I give you an answer assuming you're new to daniweb and further won't ask such questions . okay ?

your code will first get input during runtime based on the input it will call related functions(i.e. 1 for jan , 2 for feb and so on).and those related function will strart printing from 1 to last day of the month(i.e 1 to 31 in case of jan).

you might also consider to use default case(as a best practice , you can add default label as last label in switch statement).Here is how default label looks :

switch(var)
{
...
...
...
default:
show_error();
}
void show_error();
{
cout<<"Invalid Input !"<<endl<<"Input Limit is 1 to 12 ";
}

So , next don't ask such question like "what will be the output ? or create a program for ........ or something like that. otherwise you may get flurry of downvotes which finally affects your repuation here ".okay ?

hope next time you won't ask such questions and won't hijack the thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.