www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# CS304 Assignment 02 Fall 2020 Solution / Discussion Due Date: 17-12-2020

Views: 1858

Attachments:

### Replies to This Discussion

Share the Assignment Questions & Discuss Here....

CS304 Assignment 2 Fall 2020 solution idea 3:

CPP Format: (Extract Zip file)

CS304_Assignment_No_02_Solution_Fall_2020

CS304 Assignment 2 Fall 2020 Solution idea:

`#include<iostream>#include<conio.h>using namespace std;int i,run=0;class student{private:int roll_no,subject_marks;string name,section;public:void add();void display(); };void student::add(){cout"\n\n Roll No. : ";cin>>roll_no;cout"\n\n Name : ";cin>>name;cout"\n\n Section : ";cin>>section;cout"\n\n Core Subject Marks : ";cin>>subject_marks;}void student::display(){cout"\n\n "roll_no"\t\t"name"\t"section"\t\t"subject_marks;}main(){int choice;cout"\n\n No. Of Student : ";cin>>i;student *s[i];p:cout"\n\n 1. Add Data";cout"\n 2. Display Data\n ";cin>>choice;switch(choice){case 1:if(run < i){student *ptr = new student;s[run] = ptr;s[run] -> add();run++;}break;case 2:cout"\n\n Roll No.\tName\tSection\t\tMarks";for(int j=0;j<run;j++){student *ptr = s[j];ptr -> display();}break;default:cout"\n\n Invalid Value...Please Try Again...";}goto p;}`

cs304 assignment no 02 solution fall 2020

#include<iostream>

#include<conio.h>

using namespace std;

int i,run=0;

class student

{

private:

int roll_no,subject_marks;

string name,section;

public:

void display();

};

{

cout"\n\n Roll No. : ";

cin>>roll_no;

cout"\n\n Name : ";

cin>>name;

cout"\n\n Section : ";

cin>>section;

cout"\n\n Core Subject Marks : ";

cin>>subject_marks;

}

void student::display()

{

cout"\n\n "roll_no"\t\t"name"\t"section"\t\t"subject_marks;

}

main()

{

int choice;

cout"\n\n No. Of Student : ";

cin>>i;

student *s[i];

p:

cout"\n 2. Display Data\n ";

cin>>choice;

switch(choice)

{

case 1:

if(run < i)

{

student *ptr = new student;

s[run] = ptr;

run++;

}

break;

case 2:

cout"\n\n Roll No.\tName\tSection\t\tMarks";

for(int j=0;j<run;j++)

{

student *ptr = s[j];

ptr -> display();

}

break;

default:

}

goto p;

}

# CS304 Assignment Solution # 2 Fall 2020 - Object Oriented Programming

#include<iostream>

#include<conio.h>

using namespace std;

int i,run=0;

class student

{

private:

int roll_no,subject_marks;

string name,section;

public:

void display();

};

{

cout"\n\n Roll No. : ";

cin>>roll_no;

cout"\n\n Name : ";

cin>>name;

cout"\n\n Section : ";

cin>>section;

cout"\n\n Core Subject Marks : ";

cin>>subject_marks;

}

void student::display()

{

cout"\n\n "roll_no"\t\t"name"\t"section"\t\t"subject_marks;

}

main()

{

int choice;

cout"\n\n No. Of Student : ";

cin>>i;

student *s[i];

p:

cout"\n 2. Display Data\n ";

cin>>choice;

switch(choice)

{

case 1:

if(run < i)

{

student *ptr = new student;

s[run] = ptr;

run++;

}

break;

case 2:

cout"\n\n Roll No.\tName\tSection\t\tMarks";

for(int j=0;j<run;j++)

{

student *ptr = s[j];

ptr -> display();

}

break;

default:

}

goto p;

}

CS304 Assignment 2 Fall 2020 solution idea 3:

CPP Format: (Extract Zip file)

CS304_Assignment_No_02_Solution_Fall_2020

1

2

3

4

5

## VIP Member Badge & Others

------------------------------------

## Latest Activity

Zohaib Hassan posted a discussion

3 hours ago

3 hours ago

5 hours ago

9 hours ago

12 hours ago

### MTH603 Assignment no 2 Solution Spring 2021| Must Watch

12 hours ago
Adeel joined + M.Tariq Malik's group

12 hours ago