Ok, I got a bit of it done, it's just that when there's a negative number in the list, it prints out the mean is NaN. An suggestions on how to fix my code to constitute for negative numbers?
Type: Posts; User: ixjaybeexi
Ok, I got a bit of it done, it's just that when there's a negative number in the list, it prints out the mean is NaN. An suggestions on how to fix my code to constitute for negative numbers?
Alrighty, hopefully now my logic will be correct and I'll be finished. Woo! Just one thing...when I go to compile, it says i declared "n" as a double, but an int is required. I didn't declare...
Hmm, so how should i declare the array in the main?
Hey guys I have to create a program that computes the mean, standard deviation, and finds the max and min of a group of numbers read in from a file. I'm having trouble storing the objects from the...
Huh? :confused: Do you mean instead of nextInt make it nextDouble? What do I put inside the parenthesis then?
Alright so I'm having trouble creating this program, basically I need to prompt the user to enter a 1 or 2 if 1, you run a convert from Fahrenheit to celsius, or if the user presses 2, the program...
Hmm, I have the same problem. Here's my code:
import java.util.Scanner;
public class Assignment2
{
public static void main (String[] args)
{
Scanner in = new...
Ok, so here's my code:
public static int attendence (int lecturesAttended){
if lecturesAttended <= 5 {
int points = 2 * lecturesAttended;
}
else {
points = 5 + lecturesAttended;
}
OH, wow alright I think I get it now, haha, that was a lot simpler than I thought, and then I just return points back into my main..
:confused: Ya lost me, I'm kinda confused now.
Alright so basically, it should be
-if lectures <= 5, points = lectures * 2 + 5
-else lectures > 5, points = lectures * 1
Is it possible to do like points = points + points? That just...
Hmm, alright.
Could I use this algorithm?
1) In terms of n, for each lecture attended, student gets 2 points for the first 5 and 1 for there after
-If lecturesAttended > 5, points =...
that's why i'm asking you guys hahaha, i don't know how to answer the question. i could use if/else if you could teach me how to do it...?
I have no idea what your pseudo code means...we didn't learn how to do if and else statements yet
Well what I have so far is this
public class Lab6 {
public static void main (String[] args){
System.out.println("The amount of points received are " + attendence(7));
...
can anyone help me?
we don't have to have the user input the amount of lectures attended, we just have to make up a number, and in my case it's 7. i know he's supposed to get 12 points, i just don't know the math...
K, so I have to convert this problem into a method:
5) Write a method named attendance that accepts a number of lectures attended by a student, and returns how many points a student receives for...
I'm only on my second chapter in Computer Science class, so I really don't know a whole lot
woo hoo thanks guys, i still have no idea what the hell i'm doing, but at least i got the answer to my challenge problem!
Hey guys, I'm new to Java, and we're learning the For Loop in class, I don't understand it at all, and I need to create this object using for loops and nested for loops:
___*___
__***__
_*****_...