Re: i need help writing a program using array. ASAP!
i dont mean to be a pain.. but there is very less time left to submit my assignment
Unfortunately that's not my problem.
If you did what I have suggested you do without me having to repeat myself and having to keep asking for error messages and the latest code you would be a lot closer to finishing.
Re: i need help writing a program using array. ASAP!
i am so sorry i did in no way mean to offend you.... it just my first time doing this... and my nerves are getting the best of me!! but srsly thank you for being so patient with me! u have been nothing short of great help!
Re: i need help writing a program using array. ASAP!
At the bottom of every one of my post in blue writing it shows to use them. You can either type them in or highlight your code and click on the code tags button ('#').
Re: i need help writing a program using array. ASAP!
okay thank you so much for sticking with me all through this....i think this will be all now... wish me lcuk for my assignement....and i wish u the best luck!! hope i was'nt to much of a nuisance!
public static void main(String[] args){
int num = 0;
int excellentstudent;
excellentstudent = 0;
double percentage = 0;
Scanner scanner = new Scanner(System.in);
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
String s = scanner.nextLine(); // bufferRead.readLine();
System.out.println(s);
num = scanner.nextInt();
int[] studentarray;
studentarray = new int[num];
int sum = 0;
for (int i = 0; i < studentarray.length; i++ ){
sum = sum + studentarray[num];
}
int gradecount = 0;
if (sum >= 90 ){
gradecount ++;
//Sorry i dont understand this
percentage = count * 100 / num;
System.out.printf("The percentage f excellent student is : %.1f", + percentage);
}
}
[code]
Re: i need help writing a program using array. ASAP!
Code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class MyHomework {
public static void main(String[] args){
int num = 0;
int excellentstudent;
excellentstudent = 0;
double percentage = 0;
Scanner scanner = new Scanner(System.in);
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
String s = scanner.nextLine(); // bufferRead.readLine();
System.out.println(s);
num = scanner.nextInt();
int[] studentarray;
studentarray = new int[num];
int sum = 0;
for (int i = 0; i < studentarray.length; i++ ){
sum = sum + studentarray[num];
}
int gradecount = 0;
if (sum >= 90 ){
gradecount ++;
//Sorry i dont understand this
percentage = count * 100 / num;
System.out.printf("The percentage f excellent student is : %.1f", + percentage);
}
}
Re: i need help writing a program using array. ASAP!
Sorry for triple post. Anyway that is the program, after i fixed error. Just ask if you dont under stand. I think you need to read more books because you need to know how to make a "function"(or called "method" in java) and "declare variable".
Bookmarks