1,105,585 Community Members

A program to print out the names, remarks and average of five students in descending

Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Write a c program that inputs the names of the 5 students and their marks in 5 course units. the program must calculate the average for each student. If the average of the students's marks is less than 50, then your program should print against the student the string"Sorry try next year".Your progrma should also print out the student's names and average mark in descending order startisng with the student with best marks up to the one with least marks.

Member Avatar
Jishnu
Posting Pro
518 posts since Oct 2006
Reputation Points: 160 [?]
Q&As Helped to Solve: 26 [?]
Skill Endorsements: 0 [?]
 
0
 

http://www.daniweb.com/forums/thread97328.html

Atleast show your code (efforts) & specify where you are stuck up. You are expecting that someone will write the entire code for you. You've not even specified what your specific problem is about.

Write a c program that inputs the names of the 5 students and their marks in 5 course units. the program must calculate the average for each student. If the average of the students's marks is less than 50, then your program should print against the student the string"Sorry try next year".Your progrma should also print out the student's names and average mark in descending order startisng with the student with best marks up to the one with least marks.

Member Avatar
Jishnu
Posting Pro
518 posts since Oct 2006
Reputation Points: 160 [?]
Q&As Helped to Solve: 26 [?]
Skill Endorsements: 0 [?]
 
0
 

Stop posting mere problem statements of programs.

Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

the one of finding the word that appears most, i have no idea on how to go about it,
and I have submitted a template of what i have done on the one, enetering values and printing the names in the nnedded order

Member Avatar
Ancient Dragon
Achieved Level 70
27,637 posts since Aug 2005
Reputation Points: 5,232 [?]
Q&As Helped to Solve: 3,037 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

>>i have no idea on how to go about it,
start here. Now fill in the function shown below with your program requirements. Do only one little part at a time, compile and correct all errors. Then do a little more and repeat until all requirements have been fulfilled.

Example Write a c program that inputs the names of the 5 students . That tells you that you need to create an array of strings that will hold 5 student names. Do just that much and then compile.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
    // your code goes here
 
   return 0;
}
Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

why dont you help me on modifying the program, i have enterd the values and also computed the average, so how do go abour the rest

Member Avatar
Ancient Dragon
Achieved Level 70
27,637 posts since Aug 2005
Reputation Points: 5,232 [?]
Q&As Helped to Solve: 3,037 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

well, I can't read your mind -- where is your code ?

Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

let send it to you

Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 
#include <stdio.h>
int N;
float array[3];

//declaration of structure
struct marks{
  char first_name[20];
  char second_name[20];
  float CSC_2100;
  float CSC_2101;
  float CSC_2102;
  float CSC_2103;
  float CSC_2104;
  };
struct marks student[5];
 // code to compute average
float find_average( float a, float b,float c,float d,float e){
	float average =  ((a+b+c+d+e)/5);
	return average;
	}
// to sort the average marks in descending order
void bubblesort(float a[], int N)
{
 int i, swapped = 1;
	 while(swapped)
	  for (swapped = 0, i = 1; i<N; i++)
		  if (a[i] > a[i-1]) {
			  int t = a[i-1];
			  a[i-1]=a[i];
			  a[i]=t;
      }
}


	int i;
main()
{
  printf("Enter marks for five students:\n\n");
  printf("Enter your marks as floats:");
  for (i = 0;i < 3; i++){
  printf("\n\n");
  printf("Enter your First name:");
  scanf("%s",&student[i].first_name);
  printf("Enter your Second Name:");
  scanf("%s",&student[i].second_name);
  printf("Enter marks for CSC 2100:");
  scanf("%f",&student[i].CSC_2100);
  printf("Enter marks for CSC 2101:");
  scanf("%f",&student[i].CSC_2101);
  printf("Enter marks for CSC 2102:");
  scanf("%f",&student[i].CSC_2102);
  printf("Enter marks for CSC 2103:");
  scanf("%f",&student[i].CSC_2103);
  printf("Enter marks for CSC 2104:");
  scanf("%f",&student[i].CSC_2104);

  }
  for (i =0; i<3; i++){
	 printf("\n\n");
	 printf("Name :\t%s %s",student[i].second_name,student[i].first_name);
	 printf("\nAverage:  %.2f\t",find_average(student[i].CSC_2100,student[i].CSC_2101,student[i].CSC_2102,student[i].CSC_2103,student[i].CSC_2104));
	 printf("\nRemark:\t");
	  }
	  for (i = 0; i<3;i++)
	  array[i]= find_average(student[i].CSC_2100,student[i].CSC_2101,student[i].CSC_2102,student[i].CSC_2103,student[i].CSC_2104);
	  for (i = 0; i<3;i++)


  bubblesort(array, N);
  printf("\n");
  for (i =0; i < 3; i++){
	printf("%.2f\t",array[i]);
	 if (array[i]<50)
	printf("Sorry try next year");
  else
	printf("congratulations, you passed!");
  printf("\n");
	  }
  return 0;
  }
Member Avatar
Jishnu
Posting Pro
518 posts since Oct 2006
Reputation Points: 160 [?]
Q&As Helped to Solve: 26 [?]
Skill Endorsements: 0 [?]
 
0
 

Proper formatting please...

Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

okay, am trying to learn that right now. so hold on for a while

Member Avatar
Ancient Dragon
Achieved Level 70
27,637 posts since Aug 2005
Reputation Points: 5,232 [?]
Q&As Helped to Solve: 3,037 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

OMG! my comments here apply. I have no intention of trying to help you any more, you are now on my ignore list unless you at least post something that YOU have done.

Member Avatar
kiel19
Light Poster
36 posts since Nov 2007
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi, i just want you to help me with printing the names , the remarks and the average in descending order

Member Avatar
barkingkatt
Newbie Poster
1 post since Dec 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Jesus just give the people what they want write the ####en code for them, or better yet since the douchebags on this forum don't want to give the answer go to cramster where they will write the code for you

Member Avatar
Ancient Dragon
Achieved Level 70
27,637 posts since Aug 2005
Reputation Points: 5,232 [?]
Q&As Helped to Solve: 3,037 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
1
 

Jesus just give the people what they want write the ####en code for them, or better yet since the douchebags on this forum don't want to give the answer go to cramster where they will write the code for you

Oh that's a great way to teach people how to program. I suppose if you every get a job you will expect eveyone else you work with to do your work for you so that you can sit on your ### and play with yourself.

Member Avatar
WaltP
Posting Sage w/ dash of thyme
9,363 posts since May 2006
Reputation Points: 2,905 [?]
Q&As Helped to Solve: 1,151 [?]
Skill Endorsements: 45 [?]
Team Colleague
 
0
 

Oh that's a great way to teach people how to program. I suppose if you every get a job you will expect eveyone else you work with to do your work for you so that you can sit on your ### and play with yourself.

And he had to resurrect a 3-year old post to get PO'd at. He could have found a few newer ones methinks...

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article