a program that will accept student name and grades and output it.use an array data structure in the implementation this program and implement the following
write method that will traverses the array and allow the user to perform the following processes
a) search for a particular student and his or her marks
b)find the average of all the student in the class
c)find all student with a mark below 50 and output them.
ps
pls help me write the codes
5 replies to this topic
#1
Posted 29 November 2010 - 03:07 AM
|
|
|
#2
Posted 29 November 2010 - 06:15 AM
Standard first question: what do you have so far?
Standard second question: what part are you having difficulty with?
Standard second question: what part are you having difficulty with?
#3
Posted 03 December 2010 - 06:44 PM
import java.util.Scanner;
//import java.lang.String;
public class Main {
public static int n;
//public static String names;
//private static String[] nameS;
//private static String[] nameS;
/**
* @param args the command line arguments
*/
public static void main(String[] args/*,String[] nameS*/) {
Scanner in=new Scanner(System.in);
int Da=0;
int num []=new int[n];
//int x=0;
System.out.printf("%s\n","Enter the Number of student taking This Couse");
n=in.nextInt();
String name[]=new String [n];
System.out.printf("%s %s \n", "index","value");
for (; Da < name.length; Da++ )/*Da 4 Display array*/ {
System.out.printf( "%5d%8d\n", Da, name[Da] );
}
System.out.println("Enter the names of the student");
String names;
names=in.nextLine();
name[n] = new String(names);
for (; Da < name.length; Da++ ){
System.out.printf( "%5d%8d\n", Da, name[Da] );
}
}
}
i can not input the names into the array i created pls help me
Edited by Alexander, 03 December 2010 - 06:45 PM.
( # button)
#4
Posted 03 December 2010 - 06:53 PM
the Second is how will the traverses be done
#5
Posted 04 December 2010 - 01:47 PM
Well, it looks like your names input is outside the for loop.
#6
Posted 04 December 2010 - 02:14 PM
i have corrected it thankz any way
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









