Olarid01's Posts
Nairaland Forum › Olarid01's Profile › Olarid01's Posts
galatico:You know, it amazes me how people mistakes everything for love. Ask the grown-ups, you will know that common sense have to go along with LOVE Love is amazing, but there are lot of things to consider when planning a family if you don't want to run into an abyss of doom. Lets take this as an example: You said you love your girl friend right? so you don't even bother to check your blood compatibility (Why? LOVE is above everything now.....) At the end of the day, you are an "AS" and also your wife is an "AS". What do you expect will be the result (A very likelihood of an "SS" offspring). So who caused that? (bad luck?, God? your own fault?). So my brother LOVE is essential but not the only essential thing in marriage. (Talking from findings and researches) For a marriage |
Losing many girls "because you are a programmer" is actually because you work long hours. And, the thing about programming is that work isn't restricted to work hours. Bankers can leave their work in the office. A programmer can work in the office, in the bus on the way home, in bed, in the bathroom , ANYWHERE. So, given that you love your work, you'll do it a lot, and it might eat into your time for other things.My brother, you are just getting started |
candylips:My brother, it seems you don't really know what programming is. ![]() |
Cpp? I'm in |
hardebayho:Thanks |
olarid01:The variable NoOfStudents can be changed to the required number (38) but mind you inputting 5 as number of courses for year one and two will generated a input loop of 38*5*2 so, for testing sake, use small number |
olarid01:The value for the variable NoOfStudents can be changed to the number required (38) but mind you, inputting the number of courses as 5 for each year will generate a loop of 38*5....... so for testing sake, use small numbers |
hardebayho:Well done bro. But this won't take care of the two years and also it can be generalized so that the number of courses in each year will be requested at program start. Take a look a this: #include <stdafx.h> #include <iostream> using namespace std; int main() { char pause; //Number of courses per year int yone, ytwo; const int NoOfStudents = 2; cout << "\nHow Many Courses in Year One? " << "\t"; cin >> yone ; cout << "\nHow Many Courses in Year Two? " << "\t"; cin >> ytwo ; //Creating the student data structure struct Genstudent{ float *Yearone; float *Yeartwo; }; //Creating Array of students for the number of students Genstudent student[NoOfStudents]; //Initializing the students variables for(int x = 0; x < NoOfStudents; x++){ student[x].Yearone = new float[yone]; student[x].Yeartwo = new float[ytwo]; } //Getting All the Scores for(int x = 0; x < NoOfStudents; x++){ //getting the scores For Year One for all students cout<<"Student "<<x+1<<"\n"; cout<<"========="<<"\n"; for (int i=0; i<yone; i++){ cout<<"\n\tStudent"<<x+1<<": Input Score For Year 1 Course: "<<i+1<< "\t"; cin>>student[x].Yearone[i]; } //getting the scores For Year two for all students for (int i=0; i<ytwo; i++){ cout<<"\n\tStudent"<<x+1<<": Input Score For Year 2 Course: "<<i+1<< "\t"; cin>>student[x].Yeartwo[i]; } } //Printing All the Scores // For Year ONE cout << "\n\n\t\t The Scores For Year One Are\n"; cout << "\t\t === ====== === ==== === ===\n"; cout<<"\t\t"; for (int i=0; i<yone; i++){ cout<<"Course "<<i+1<<"\t"; } //putting a line break cout<<"\n"; for(int x = 0; x < NoOfStudents; x++){ //getting the scores For Year One for all students cout<<"Student"<<x+1<<": "<<" \t"; for (int i=0; i<yone; i++){ cout<<student[x].Yearone[i]<<"\t\t"; } cout<<"\n"; } // For Year TWO cout << "\n\n\t\t The Scores For Year Two Are\n"; cout << "\t\t === ====== === ==== === ===\n"; cout<<"\t\t"; for (int i=0; i<ytwo; i++){ cout<<"Course "<<i+1<<"\t"; } //putting a line break cout<<"\n"; for(int x = 0; x < NoOfStudents; x++){ //getting the scores For Year One for all students cout<<"Student"<<x+1<<": "<<" \t"; for (int i=0; i<ytwo; i++){ cout<<student[x].Yeartwo[i]<<"\t\t"; } cout<<"\n"; } //Deallocating All the used Array for(int x = 0; x < NoOfStudents; x++){ delete [] student[x].Yearone; delete [] student[x].Yeartwo; } cin>>pause; return 0; } |
Number of courses? of do you want it to be generalized? And what type of paradigm to use? POP or OOP? |
What type of company do you did your IT in? |
