Reply Thu 12 Jan, 2017 12:36 pm
how i complete it ,,



https://pictr.com/images/2017/01/13/a9b2f6c450c1049245210aeee910fe6e.gif

#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
struct Student {

string Course_code ;
char Course_name[100];
char Semester[50] ;


};
Student InputCourses(Student);
void DisplayData(Student);

int main(){
Student s;
s = InputCourses(s);
DisplayData(s);
system("pause");
}
Student InputCourses(Student s){
int i;
for(i=1;i<=5;i++)
{

cout<<"enter course code"<<endl;
cin>>s.Course_code;
cin.ignore();
cout<<"enter course namee"<<endl;
cin.getline (s.Course_name , 100) ;
cout<<"enter semester"<<endl;
cin.getline(s.Semester , 50);

}

return s;


}

void DisplayData(Student s){

cout << "\n# CourseCode CourseName Semester LaunchingYear." << endl;
cout<<setfill('-')<<setw(75)<<endl<<endl;
int i;
for(i=1;i<=5;i++)
{
cout<<"\n" <<i<< "\t " << s.Course_code <<"\t\t " <<s.Course_name << " \t\t\t " << s.Semester<<"\n";

}


}
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 0 • Views: 524 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » Structures
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/05/2024 at 01:22:13