Skip to content
Advertisement

Tag: arrays

Java – Displaying the temperature statistics of the week using arrays

I am currently working on a problem set for an assignment at school, and I’m really close to finishing however I’m getting a few compilation errors. The problem set includes displaying the weeks avg. temp, highest temp., lowest temp., and the days of the week that are hottest and coldest. Currently what I’m trying to do is display the days

Calculate factorial of 50 using array only in java

I’m a total beginner of java. I have a homework to write a complete program that calculates the factorial of 50 using array. I can’t use any method like biginteger. I can only use array because my professor wants us to understand the logic behind, I guess… However, he didn’t really teach us the detail of array, so I’m really

ATM Machine in Java

I have been trying to figure out what is going wrong with this program I’m writing. Heres the full description of what I’m trying to do: Use the Account class created in Programming Exer- cise 9.7 to simulate an ATM machine. Create ten accounts in an array with id 0, 1, . . . , 9, and initial balance $100.

Finding the mode of a 2D array

I’m trying to return the mode of a 2D array using a frequency array. I have an array, score, which is of length 10, and has 3 columns. Each column contains an int that is between 0 and 100. I’m trying to find a way that will iterate through the array and return the modal value. What I have so

Getting only the first name in an array

I have an array list like this: ArrayList names = new ArrayList<>(); that stores people’s first and last names when they are entered in different textbooks. So when prompted to Joe Biden would be element number 1 then Barack Obama would be element number 2 in the array list. My question is that if it is possible to only get

Advertisement