All Questions
429 questions
-1
votes
2
answers
104
views
Making a Histogram using an Array of integers
I’m trying to make a method that takes a String and then fills an array based on the frequency of letters in the string where the array[0] is the number of A’s etc. Then it takes the array and prints ...
1
vote
1
answer
34
views
How to get letters and ints from a single string, considering that 2 (or more) ints can be together and should be treated as a single int?
How do I get letters and integers from a single string, considering that 2 (or more) integers can be together and should be treated as a single integer?
So let's take an string "a2bc31d" as ...
0
votes
1
answer
54
views
Difference of outputs of print of int[] ,String[] and char[] in Java
My question is simple .I know output but i can't know why is different outputs of all of them.
Firstly, i wanted to get output of array what is created newly and is empty .i coded like that:
(https://...
0
votes
0
answers
65
views
VBA frustration: Storing integers in an array but VBA thinks they are strings when referenced
In the code below I define the variable TP as an array. The first time TP = Array(Min + 5, Min + Div, Min + Div * 2, Min + Div * 3, Min + Div * 4, Max - 5, Max - 5). When TP(0) is referenced, vba sees ...
0
votes
1
answer
145
views
Why do string-to-int functions (e.g. strtol(), atoi(), sscanf()) keep returning 0 when given array of hex values?
Problem:
I am making a file interpretation program that needs to read/write Hexadecimal values. At times, there will be a section of hexadecimal that needs to be read as one long hex value, rather ...
0
votes
1
answer
101
views
Counting Letter Occurrence and Printing a Word Integer Array in MIPS
I am currently working on an assignment for an Assembly Language class and have hit a wall with why it is not working properly.
I need to count the occurrence of each alphabetical letter (a-z) into a ...
-1
votes
2
answers
86
views
In C++ why is it here that when trying to add two digits from a string doesn't work even though the the digits are correct but sum is not.? [duplicate]
#include<iostream>
using namespace std;
int main()
{
string s="145245";
cout<<s[0]+s[3];
return 0;
}
hello i am beginner
I tried to find the solution in ...
0
votes
1
answer
546
views
rust convert binary int to string or array of numbers [duplicate]
i have an integer like this:
let x: u8 = 0b101;
and i need to convert it to string like this:
let s = "101";
or array:
let a = [1, 0, 1];
but rust by default converting already converted ...
0
votes
1
answer
285
views
How to replace all even elements in an integer array with a special symbol '$' using java
We have an integer array and all even numbers in that array must be replaced by "$";
Here is my code :
int[] array = {1, 2, 3, 4, 5, 6};
char specialChar = '$';
for (int i = 0; i < array....
1
vote
1
answer
1k
views
Power Automate - Need help sorting an array based on one field that's a number in string format
I have an array of data and all values are in string format due to some prior JSON operations in the flow. I need to sort the array based on one field which are numbers (in string format). I'm using ...
0
votes
3
answers
250
views
Can I define and assign an integer array at the same time like we do with the string array?
Here is how I defined and assigned a string array at the same time
#include <stdio.h>
#include <cs50.h>
#include <string.h>
int main()
{
string word = get_string("Enter a ...
-1
votes
1
answer
37
views
i need to fix this python code so it generates a username i am a beginner so this is probably a simple fix im unaware of
Fname=input("What is your forename? ")
Sname=input("What is your surname? ")
age=int,input("What is your age? ")
randNo=int(input("Enter a random number that is NO ...
0
votes
1
answer
292
views
Printing an integer array in java using for loop, but the first element is always zero
I have been trying for hours to change a user inputted string of numbers into an integer, then create and print an integer array with those integers. I finally got it, but the first element of the ...
0
votes
2
answers
47
views
why is my console displaying my result as numbers insteadof the actual string in my array in the code below [duplicate]
var arrayNames = ["Angela", "Ben", "Jenny", "Michael", "Chloe"];
function whosPaying(names) {
var bigBoss = arrayNames.length;
var ogaMi = Math.floor((Math.random() * bigBoss));
return ogaMi + ...
-1
votes
3
answers
246
views
How to remove the commas from string with no spaces for int conversion
I'm trying to remove the commas from this data set so they can be converted to int and be summed up all but I can't seem to find any way to do it without introducing spaces to the number values.
...