Thank you very much for your help and tip on just posting the problem code. I was able to finally fix all the issues. However, I have another assignment to make a fake credit card encryption type project. If I run into any problems with it, I will be sure to post only the problem code. Thanks again!
Hello, I cannot seem to get the calculations correct for my shopping cart to print out the tickets and total how many tickets and how much they are. The first set of code is for the shopping cart the comment sections are for what is suppose to be happening in each section. I have the menu...
The second half because it is asking something different will not return false even if the same modifications are made. I tried taking out the if statements and neither worked in doing so. Therefore, test 5 still won't return false. What do I do?
terminal output
Test 1: true
Test 2: true
Test...
One more question.
I keep getting the wrong return values:
Terminal Output
Test 1: false// should be true
Test 2: false//should be true
Test 3: false
Test 4: true
Test 5: true//should be false
Test 6: true
MyCode
public class ArrayProblems1 {
public static void main(String[] args) {...
Oh ok how do I do that? I tried adding another int[] array but it said it was already defined, then I tried int[] int[] array, and int[][] array, none of which worked. We didn't go over this stuff in class so I am confused I am sorry.
Oh ok. Opps sorry I went ahead and fixed it but my compiler (Terminal) doesn't like the fact that the arrays are different lengths. Since the problem requires this What should I do?
ArrayProblems1.java:18: error: method linearIn in class ArrayProblems1 cannot be applied to given types...
Ok so I cleaned up my code. Now when I try to compile it returns these errors and I don't understand why, I tried to fix the curly brackets and I tried to fix the arguments still no luck. My new code is below.
ArrayProblems1.java:44: error: illegal start of expression
public static int...
Hello,
I am stuck on this java problem. I was wondering if anyone can figure out what I am doing wrong. Thank you!
Problem
1. Given an array of ints, return true if there is a 1 in the array with a 2 somewhere later in the array.
ex: has12([1, 3, 2]) → true
has12([3, 1, 2]) → true...
I tired it with just the itemsList[i] but I received a error. I now understand the error must have been with another part of my code. The division was only a temporary fix to answer the first two outputs but it was to specific, so I needed a more generic answer. I retyped my portion of the code...
Hello, I am stuck on this question.The bold part is where I am stuck. I was able to get at least 2 out of the 3 test outputs but I can't seem to get the last one. I tired taking out the dividing by 2 but then the first test output doesn't work. Thank you.
Question:
For any element in keysList...
Hello,
I have a question. I have to create a calculator for grades. I need to make a menu and the student picks either the lab or the lecture which I didn't have a problem with. I also didn't have a problem with the set up of the questions or the average calculations. What I am stuck on is: I...
Yes! It worked! Thank you for your help. I tried the else/break as you suggested before hand. I forgot to remove the continue and that was causing the error I was receiving. I am unsure; it's a embedded challenge in my java digital textbook. They don't give much instruction sometimes and they...