I am tying to throw an exception when a BigInteger is greater than Integer.MAX_VALUE. It will not allow me to throw that exception for the exponent case. I am not sure how to get it to throw an exception when the biginteger value is too large to pass into the BigInteger.pow() method.
Thanks in advance.
here is the toPostfix method:
...
hi, i am not sure how can i read a number like 10 and above for a char array, i am converting from infix to postfix , currently i am able to do so for single digits however when it comes to multiple digits when evaluating the postfix equation it would be a wrong answer. for example 10+13+4 it would give a wrong answer but 1+3+4 it would ...
So I need help on an assignment and I've been trying to solve it for more than a week, but I need help on putting an arraylist inside a listbox.
http://i29.tinypic.com/ib9oiu.jpg
That's what the GUI should look like in the end, all the information has to be saved in an arraylist; I should be able to add a new customer; click on a custom...
Suppose list is an array of six components of the type int.What i stored in list after the following Java code executes?
list [0] = 5;
for (i =1; i < 5; i++)
{
list[i] = 2 * i + 5;
if (i % 2 == 0)
list[i] = list[i] - 3;;
}
...
Imagine you have some code that could potentially throw an exception. For example, you try
to send an e-mail message to a mail server, or write a file to disk while you’re not sure if you have the right permissions to do so. What kind of exception handling strategy would you use to avoid the exception from being displayed in the browser?...
the fallowing is a tic tak toe game code in python, can some one show me how i can make it in GUI form with a reset option and shows who wins at the end. like X win or O win?
board = " 1 | 2 | 3\n-----------\n 4 | 5 | 6\n-----------\n 7 | 8 | 9"
.
checkboard=[1,2,3,4,5,6,7,8,9,1,4,7,2,5,8,3,6,9,1,5,9,3,5,7]
spaces=range(1,10)
def mo...
In C#/.NET:
I have 2 concrete classes. Class A and B. Class B subclasses from Class A.
How many instances (objects on the heap) and references from the stack to the heap objects are created for each line of code:
ClassB b = new ClassB();
ClassA a = new ClassB();
Thanks!
...
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int value;
struct node *next;
}LLIST;
LLIST *list_add(LLIST **p, int i)
{
if (p == NULL)
return NULL;
LLIST *first = malloc(sizeof(LLIST));
if (first == NULL)
return NULL;
first->value = *first;
*p = first;
first->value = i;
}
i...
Recently been given this work to do, I am new to programming so I don't really know alot about it or how to use it. I suppose it would be easier to just be given the code, but I would like to know how to do it myself to. Have tried reading up on the language and trying it myself but im just not grasping it very well. Any help is greatly ...
Several questions on "what is the shortest code for this?":
1) Without {}
if($match->name == "Marry") {
$match = true;
}
2) Without {}
if($match->name == "Marry") {
$match = true;
} else {
$match = false;
}
3) How to ask if $match = true?
4) How to ask if array() has any value?
5) How to ask if $variable has ...
Can anyone help, I'm using visual c# express edition 2008 obviously dealing with c#. I have a form with two text boxes, in one I want to show a .txt file in text format and in the other text box I want to show the same text but in hex. I have no idea how to do this as programming isn't a strong point of mine. Also its got to be in whole ...
I am writing a program that takes letters and converts them to telephone numbers. I am just starting out in c++ and not really familar with classes or members which most of the examples I've seen on the web involve these concepts. I have the switch case portion working but cannot get the end of file part right. I have copied my code belo...
Hello, I'm new to Stack Overflow, and this is my first question/post! I'm working on a project for school using Java. The first part I'm having trouble with inolves:
Read each line in a file (listed at the end of my post) one time
Create a "ragged" array of integers, 4 by X, where my 4 rows will be the "region number" (the number found...
SigTerm said this:
"Smells like a bad code. squareOne..squareSix should be probably array. Instead of char constants, enums or ints should be probably used... "
How do i do that with this code for the board also if someone could suggest the code I would have to use to get users to enter the row and column for the X and O for the game.
v...
How do I make a save button in the menu strip in the form view in visual c# express edition?
...
hi guys, I'm stuck with a homework..
How can I from this table check what cID, sID = '03' are taking? And with that, checking other sID that got the same cID as sID = '03' and select it out?
sID cID year grades
--------------------------------
01 L21D 1997 4
01 L24D 1998 2
01 L32D 1998 3
02 L21D 19...
hi, i am trying to have a regular expression split on equations like 1.5+4.2*(5+2) with operators - + * / so the output would be input into a array so i can parse individually
[0]1.5
[1]+
[2]4.2
[3]*
[4](
[5]5
[6]+
[7]2
[8])
i have found out that the \b will work on 1+2+3 however if i were to have decimal points it would not split. i...
I am trying to implement a custom memory manager, I am wondering if there is a better way to implement this function as when i asked about void pointer arithmetic, several people thought that if i had a void* in C++, something was very wrong.
// allocates a page of memory.
void ObjectAllocator::allocatePage()
{
//if(OAStats_.Pag...
I'm doing a homework assignment where I need to display an image and then allow the user to resize the image witha JSlider. I have the image displaying, but Im not sure how I could use a slider to change the size. As I understand sliders, there are 3 parameters that control the default value, the max slider value, and the min slider valu...
Hi can somebody help me with the matlab command here. I've got to determine the highest point in a filled contour i've plotted using matrix data in a file. And then i have to mark the highest point with a red 'x'.
load('0101862_mod.dtm') % loading the dtm file
X = X0101862_mod(1:81,:) % we name X0101862, it is the location where the ...