We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Assignment No. 02
Semester: Spring 2015

CS201: Introduction to Programming

Total Marks: 20

Due Date: 12/06/2015

Lectures Covered: 7 to 16

 

Please read the following instructions carefully before submitting assignment.

It should be clear that your assignment will not get any credit if:

 

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • Assignment is copied(partial or full) from any source (websites, forums, students, etc)
  • Assignment solution is not in .cpp file format.

 

Objective

 

The objective of this assignment is to provide an on hand experience of:

  • Learn to code, edit, compile and execute C++ program.
  • Learn to use two dimensional array declaration and manipulation.
  • Learn to manipulate array with the help of pointer
  • Learn to create user defined functions

Guidelines

 

  • Code should properly be indented and well commented.
  • Follow C/C++ naming conventions while using variables, functions etc.
  • Use only Dev-C++ for this assignment. If you are using any other tool then mention the name of tool and version on top of your code file as comments.

 

Assignment Description

 

This assignment is divided into two parts. In first part, you will be provided with sample startup code (attached with this assignment in folder Startup Code) that will populate 2D array with random numbers from 1 to 100 and display on console. Given code also finds the element with maximum and minimum values in array. Output of sample code is given below as Figure 1. We will help you to understand and practice the given code through Adobe Connect lab sessions. For details of lab sessions see announcement of Adobe Connect Lab Sessions.

 

The displayMaxMinElement( ) function in startup code that is finding maximum and minimum element will help you get the desire output. To get the desired output, you should find the sum of each row and compare with sum of other rows to find which row’s sum is maximum. The same procedure can be used to find row which have minimum sum as compare with other rows in 2D array.

 

Figure 1: Sample output of the Startup code

Your Task

In this part of assignment, you have to modify given startup code and find the row from 2D array whose sum is maximum as compared with sum of other rows. You also have to find the row whose sum is minimum as compared with other rows. Screen shot of the desire output is given in Figure 2.

Figure 2: Sample Desired output

Submission

You are required to submit your code through LMS in .cpp file format.

 

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 9285

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

ye run hua kia?

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

kya hum usi prg m add kr sakty hn?

yes us program main he add kerin gay

Assignment File

Attachments:

How to modify the code kindly anyone can help me ? 

what function is needed to modify code ?

did u read the function names?

the function with the name display , we have to edit that one

how to find max and min row?

any one help me in this assint

#include<iostream.h>

#include<conio.h>

#include<stdlib.h>

void displayMaxMinElement(int array[10][10]){

int max=0,min=100;

for(int i=0;i<10;i++) {

for(int j=0;j<10;j++) {

 

if(array[i][j]  <= min)

min=array[i][j];

 

if(array[i][j] >= max)

max=array[i][j];

}

}

cout"\n\n Array Element with maximum value:"maxendl;

cout"Array Element with Minimum valaue: " minendlendl;

cout"Row No.8 has maximum sum:"array[6][0]+array[6][1]+array[6][2]+array[6][3]+array[6][4]+array[6][5]+array[6][6]+array[6][7]+array[6][8]+array[6][9]endl;

cout"Row No.7 has minumum sum:"array[7][0]+array[7][1]+array[7][2]+array[7][3]+array[7][4]+array[7][5]+array[7][6]+array[7][7]+array[6][8]+array[6][9]endl;

}

void fillBoard(int array[10][10]) {

srand(time(0));

for(int i=0;i<10;i++)

{

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

{

array[i][j]=rand()%100+1;

}

}

}

void displayBoard(int array[10][10])

{

int *ptr = *array;

for(int i=0;i<=100;i++)

{

cout*ptr"\t";

ptr++;

if(i%10==0)

coutendl;

}

coutendl;

ptr=NULL;

}

main()

{

int board[10][10] = {0};

fillBoard(board);

displayBoard(board);

displayMaxMinElement(board);

system("pause");

return 0;

}


Read more at http://vustudents.ning.com/group/cs201introductiontoprogramming/for...

RSS

Today Top Members 

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.