Forums Register Login

Program Review

+Pie Number of slices to send: Send
Hi guys, I had a question before on a code that I had problem with. Heres my finished project, I only have one small problem still, Ive tested every part and every part compiles and runs up until the last few lines and I cant seem to figure out why. The errors I get are below. The process Im trying to do is use a string to print out the else if statements in my code. I attached my full code below and was wondering if I could get a quick check just to make sure the way Im trying to call my final calculation is correct. It would be much appreciated. This is indeed a homework assignment, but Its already past the due date so I just want to find out the answer for myself thanks!









+Pie Number of slices to send: Send
Also quick note, in line 111 I just realized It wasn't finished. At the moment it is in a public static double, but should I use a "public static double calculateScore(double assigns, double inclass, double labs, double midterm1, double midterm2, double finalexam){" instead to pass the variables for calculation, or have it a public static double?
+Pie Number of slices to send: Send
You can't define functions inside of other functions/methods. Take a look at line 124; if you want the code to compile you should move the "inner" function you're declaring there to stand as a function by itself.
+Pie Number of slices to send: Send
Starting with line 129, it looks like you have redundant code. If you're going to assign a value to grade, you should use it like this:

otherwise the grade variable is not necessary.
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1043 times.
Similar Threads
trying to make ths work
Whats wrong with my code
Averaging Grades Assignment
Grade Calculator Alot of Errors While Compiling
grade program
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:54:56.