Ok, so here's my code:
public static int attendence (int lecturesAttended){
if lecturesAttended <= 5 {
int points = 2 * lecturesAttended;
}
else {
points = 5 + lecturesAttended;
}
Type: Posts; User: ixjaybeexi
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...