139 Topics
|
|
I've been scouring the internet and my textbooks and haven't found any good explanations about how to incorporate hexadecimal numbers into my C++ code. I am currently working on a program that acts as a simulated computer environment to run a simulated machine language in the console a maximum of … |
|
I am working on a VideoServer for my company, and in making the cgi files for the Web interface, I came across the following error: " invalid conversion from ‘int’ to ‘VideoOutputMode‘ " This was from line 4 of the below code, in the WebInterface file: [CODE]form_iterator vout_mode = formData.getElement("DisplaySettingsVOutMode"); … |
|
Need a little help, I'm trying to run a program that asks the user to enter an integer between 1-50. If given a number between 1 and 50 then echo number then add all integer between 1 and integer entered if user enter an integer not between 1 and 50 … |
|
I want to reverse and array of integer recursively, I think this is the way but I get this error when trying with a 5 integer array: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5 at name.of.package.ArrayAscDesc.CambioAscDesc(ArrayAscDesc.java:12) at name.of.package.ArrayAscDesc.main(ArrayAscDesc.java:34) Here's the code: [code]import java.util.Scanner; public class ArrayAscDesc { public static int[] CambioAscDesc … |
|
I have a variable [B]x[/B] declared as [B]int *x = y[/B], where [B]y[/B] is also a pointer variable. Is there any way to store the variable in [B]y[/B] to [B]x[/B] without making [B]x[/B] a pointer such that it would look like: [CODE] int x = y; //y declaration => int … |
|
The problem for my CMPT103 class is to write a program that takes a binary number as an integer and returns it as a decimal, i would be able to do this easily by taking it as a charecter array and dealing with each individual element but i dont understand … |
|
Hi ~ My program seems to work perfectly with the exception of validating user input. I do not want someone to do the work for me, I don't learn anything that way. I need to know why it works not just what or how. I just need a push in … |
|
I'm very new to Java 4 1/2 weeks into my intro to java, I have to write a program that asks user for an integer, the program will then add up all integers from 1 to N and display output message the sum of integers from 1 through (integer input … |
|
Hi, its an assignment i need to do. The while loop working on well when i input an integer but when a letter is being input, the while loop run for infinity. I had seen through the other thread but still cannot understand how to do. Please help... [CODE]while(choice!=1&&choice!=2&&choice!=3&&choice!=4) {cout<<"The … |
|
I created a console program in jcreator (java) which asks the user to enter a number in string and converts that string value into char array and then converts each char array into an integer which I also stored each as an array and then adds all the value from … |
|
How to read only integers from a file in java? Suppose the file has something like this: (14,2,3),(2,3,4) (2,6,78) Now I want to read only the integers not the brackets and commas.How do I do it? |
|
I'am beginner in Java, and I'am having a lot of problems while typing or making the sum of numbers. The fact is that I want to calculate the sum of pressed numbers until I press -9999, meanwhile when I press -9999, I want program me to show the sum of … |
|
Hi everybody, I really need that code, I have a text file 32 4 12 13 4 12 0 0 0 0 0 3 2 3 4 and I want to convert it vector or array like A[2]={32,4} B[4]={12,13,4,12} C[9]={0,0,0,0,0,3,2,3,4} The size of the vector or array can be changed … |
|
Hi all, I was wondering if someone could help me with this bit of coding. I have set two veriables d1 and d2 to pick a random int of 1 to 10: which I need for in loop but when I run it the same number appear How do I … |
|
Hey, I'm new to Python and wondering about the following bit of code. It tells me that the module random has no attribute randint. I've looked at the documentation and such and I think I'm doing it correctly, but obviously something's wrong. Any ideas? Thanks! [code] import random int1=random.randint(1, 6) … |
|
So I have problem with a code I am writing, when I write a string to a text document, I get the following error; "Conversion from string "1, 1, 2, 3, 5, 8, 13, 21, 34, 55" to type 'Integer' is not valid." Please help; code below. Thanks in advance! … |
|
Hi I need to have an array in my program that is defined by the user. I just need the user to enter the size of the array and then enter the integer values that they want to store in the array. I know how to declare the array myself, … |
|
I have this recursive method that counts the amount of negative numbers that lie in the array called "NumArray" [CODE]public static int countNegative(double[] NumArray, int startIndex, int endIndex) { if (startIndex == endIndex) { if (NumArray[startIndex] < 0) { return 1; } else return 0; } else if (NumArray[endIndex] < … |
|
I need help in reading a text file and by using a switch statement the user can either press 1 to find the average of all the integers in the text file, and by pressing 2 they find only the averages of the real numbers (only positive integers) in said … |
|
hi I need a program in C++ that returns the number by only integers; for exmaple if you input a numbre X= 43756, the program will show: 6 5 7 3 4 and it will also show the number: 4 3 7 5 6. Please someone help me |
|
Here the code for get three digit value 'n' and calculate r=2^n+1 then find that value 'r' is a prie or not, here i like store the integer value 'r' without exponential function and big Integer, please make a great help to me. thanks in advance.. import java.*; import java.io.*; … |
|
Hi, i accidentally given input as character for a integer variable.....then the program went crazy and just flooded the console..... so, is there any way to handle this exception......and how to achieve that thank you |
|
hi, im trying to read and write an array of integer to/from a file. i use this to write to a file: [code=c]fwrite(texel, sizeof(int), size, fp);[/code] and this to write it: [code=c] (*out) = new int[size]; fread((*out), sizeof(int), size, fp); [/code] but the data read from the same file is … |
|
Hey, I was wondering if any one could help me with several problems I am having. 1st problem: Can anyone tell me how to combine two int's and put a ':' in between. Bascially I want the user to enter the hour and minutes separately, then combine them both together … |
|
5. Write a program to automatically generate the telephone numbers. The requirements are as follows: Declare a character array to hold a 7-digit telephone number •Accept the telephone number as a string. The first four digits is the department code and the last three digits is the telephone number. (Example: … |
|
hy! I am writing an integer array class. but there is problem to return array from getter function. any one tell me the procedure of this task. And tell about extract operator for that class.[code]#include<iostream> using namespace std; class integer{ friend ostream& operator<<(ostream& output, const integer& num); private: int array[10]; … |
|
Please see the comment on code below to see the problem. [CODE]<html> <head> <title>Sequence: x ^ n -1</title> </head> <body> <script type = "text/javascript"> var sqn; var pow=1; var pans=1; do { sqn = prompt("Enter Sequence: "); }while(sqn<0); var psqn; psqn=parseFloat(sqn); if (psqn==0){ document.write("0"); } else if (psqn>0){ document.write("9<font color=red> … |
|
Hello! I'm new to c++ but I have a problem and desparate for help. I'm trying to store string and integers into a file, but only strings get stored and integers dont. I tried casting,didnt work. Not to convolute you with my code, I came up with this small program … |
|
|
I am trying to edit my current homework assignment to include a loop that lets the user repeat the computation for new values until the user says they want to end the program. I was given a hint to use integer division and the % operator to implement this function. … |
Hi i'm new to using c++ and i would like to ask if you could help me out. I have to somehow get a working c++ program that will allow me to convert any one, two or three digit positive integer into words using string/array method. Say, 111 will be … |
The End.