+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Assignment No. 02 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:
Objective
The objective of this assignment is to provide an on hand experience of:
Guidelines
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.
Submission You are required to submit your code through LMS in .cpp file format. |
Tags:
+ 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)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?
Assignment File
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...
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post