Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 26th, 2007, 7:05 AM   #1
michelle_789
Newbie
 
Join Date: Nov 2007
Posts: 1
Rep Power: 0 michelle_789 is on a distinguished road
2d array

#include<stdio.h>
#include<stdlib.h>
#define column_size 30
#define row_size 50

void input_table(int *rows,int *column,int arr[][column_size]);
void output_table(int rows,int columns,const int arr[][column_size]);

int main()
{

	char scoretograde(int score);
	int test_score[row_size][column_size];
	int rows,columns;
	char grade;
	
	input_table(&rows,&columns,test_score);
	output_table(rows,columns,test_score);

	return 0;
}

void input_table(int *no_of_rows,int *no_of_columns,int arr[][column_size])
{
	int i,j;
                printf("\n");
	printf("\t\t\tuniversity of sunderland \n");
	printf("\t\t\t------------------------\n");
	printf("\n");
  	printf("Enter number of rows    : ");
	scanf("%d",&(*no_of_rows));
	printf("Enter number of columns : ");
	scanf("%d",&(*no_of_columns));

	for(i=1;i<=*no_of_rows;i++)
		for(j=1;j<=*no_of_columns;j++)
		{
			printf("Enter value of test score[%d][%d]  :",i,j);
	     	scanf("%d",&arr[i][j]);
		
		}
}
void output_table(int rows,int columns,const int arr[][column_size])
{    
	int i,j;
	
                system("cls");
	printf("\n");
	printf("\t\t\tEXAMINATION PERFORMANCE REPORT\n");
	printf("\t\t\t------------------------------\n");
	printf("\n");
               printf("Student No\tAACS1084\tAACS1123\tGrade Point Average\n");
	printf("----------\t--------\t--------\t-------------------\n");

	for(i=1;i<=rows;i++){
		printf("\t\n%3d",i);
	for(j=1;j<=columns;j++)
		printf("\t\t%3d",arr[i][j]);
	}
		
	printf("\n\n");
	printf("AVERAGE GPA = %d\n ");
	printf("\n");
	printf("HIGHEST GPA =  %d     obtained by student No.=\n");
	printf("LOWEST  GPA =  %d     obtained by student No.=\n");



	printf("\n\n\n\n");




	printf("\t\t\tRESULT ANALSIS REPORT\n");
	printf("\t\t\t---------------------\n");
	printf("\n");


   
	
}

Last edited by DaWei; Nov 26th, 2007 at 7:40 AM. Reason: Added code tags.
michelle_789 is offline   Reply With Quote
Old Nov 26th, 2007, 7:24 AM   #2
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
Re: 2d array

Use code tags
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old Nov 26th, 2007, 7:42 AM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: 2d array

Are you asking a silent question? Showing off your code? Demonstrating your inability to post your code in tags? Pray, enlighten us.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 27th, 2007, 8:23 AM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Re: 2d array

Invisible fonts again, man I wish we could turn those off in the preferences.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem processing file into a char array csrocker101 C++ 1 May 8th, 2007 11:50 PM
Need help setting up this array programj Java 12 Apr 23rd, 2006 9:04 PM
changing size of an array Eric the Red Java 3 Apr 3rd, 2006 8:19 PM
Installing IPB 2.03 bh4575 Other Web Development Languages 0 Apr 23rd, 2005 2:36 AM
Converting 1-dimensional array to 2-dimensional array Tazz_Mission_13 Java 6 Apr 8th, 2005 11:58 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:28 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC