## Getting out the xPos and YPos valueses from a arraylist

I have this java class: public class Coordinate { //Instansvariabler (klassvariabler, objektvariabler) int xPos, yPos; //Konstruktor public Coordinate(int xPos, int yPos){ …

## Convert bytes array to int python wrong result

I know this should be easy, but I just can’t get the syntax right for python. My int is not converted correctly. This is the output of my 2 print statements. My output should be 9718 instead of …

## Function to insert integers in an array in a sorted way

So assuming that i start with an array [0,0,0,0]. And in this array i will be adding exactly 4 values. Lets say 2,1,3,4. So my main function will look like: public static void main(String[] args) { …

## Check if an Integer Array can be Equalized using Recursion in Python

Given an integer array of size 5 with arbitrary positive values and m, I am tasked to create a program that will check if it is possible to equalize this array (all integers are equal) with the …

## How can I deallocate the last element of an array in C++?

I have a dynamically allocated array like this: a[1,2,3,*unallocated value*] which has 4 elements. I also have a length variable from which I know how long it is. I want to remove the last element in …

## Hello im having a little problem with this code

private int calculateWeekDay() { if (this.month == 1 || this.month == 2) { this.month += 12; this.year -= 1; } int h = (((this.day + (13 * this.month + 1) / 5) + this….

So i have to make kinda like a timer and this has to be a string and it has to have a 0 before if it is smaller than ten so like 00,01,02…09,10,11 so all numbers are 2 digits. But I’ve ran into a …

## Java Integer Array Rotation (Left)

I have a simple rotation function which takes an array and a number to rotate the numbers left e.g. [1,2,3,4,5] & 2 – output: [3,4,5,1,2]. I want to know the most efficient way of completing …

## Converting each line from a list of integers into an array of integers?

I’m new to Java, so apologies if any of this is unclear – I want to convert a list of four-digit integers into a list of integer arrays – i.e if I have an integer that is 4567, I want to convert that …

## The number of lines that contains integers in a file

I tried this but it doesn’t work: count1=0; count2=0; for n in \$* do for(i=1;i<='wc -l <\$n';i++) do if [[ \$i == *"[0-9]* ]]; then count1=count1+1; else ...