You are running in to a problem known as "breaking the stack", which is why the exception doesn't have the relevant stack trace data. You were on the right track, but need to change the code so it looks like this:
The difference here is that throw ex; throws a new exception where throw; re-throws the original exception.
That being said, you really should try to avoid catching general exceptions and catch specific exceptions that you know you can recover from. What is the difference between SpecialCleanup and NormalCleanup?
In just two days, tomorrow will be yesterday.
We know that XNA tool is good for develop games,
We also know that Visual Studio 2005 with DirectX9.0c SDK is another tool to do this ,It use DirectX3D's classes to build the game ,I have found that the XNA tool uses its own classes, any differents between XNA environment and DirectX SDK if only runs on PC?
I would like to know if it is possible to read a particular file from DVD present inn the DVD -Rom . The concept is the Main exe should search for all dvd-roms in the system to find this file and should call another exe if the file exists in any one of the DVD in the DVD-ROM.
I don't know how to read from DVD -ROM with C#.Any Help would be appreciated
I am newbie at this, please try to be patient with me. In my class at school we have been trying out various loops in problems. The instructor calls the one we've been using a "Sentinel Loop". If there is another name for it I don't know what it is.
I can get it to accept the input and also the stopping statement. I can even get the program to tell me the sales tax and shipping "on an individual input".
The instructor wants to be able to input several figures and when the stopping statement is triggered, have the program show the total shipping cost and sales tax for all of the inputs together.
I have placed the math parts between the two input statements, and also outside of the loop.
My question is: "Do I need to put the math section into a method and if so where would I place the calling statement so that it would only work after the stop statement is triggered or would something else be even more appropriate?"
I have been beating my head against the wall for the last 10 days, and have not figured out an answer. I have tried everything I can think of.
Can someone either please answer the question or at least steer me to the information on how to do this type of a problem. I would appreciate it greatly.
This is the main body of my sentinel loop program. I can get it to work fine.
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
namespace Exer4Chpt6<br />
class Program<br />
static void Main()<br />
string inValue = "";<br />
double salesAmount = 0;<br />
double salesTax;<br />
double shipAmount = 0;<br />
double grdTotal;<br />
const double INTEREST_RATE = .07;<br />
double overAllTotal = 0;<br />
double totalShippingAmt = 0;<br />
double totalSalesTax = 0;<br />
Console.WriteLine("Enter as many different sales amounts ");<br />
Console.WriteLine("as you want. You will be shown the sales ");<br />
Console.WriteLine("amount, sales tax, shipping amount, and ");<br />
Console.WriteLine("the grand total. To Stop, enter");<br />
Console.WriteLine(" -99");<br />
Console.WriteLine("Please type in a sales amount.");<br />
inValue = Console.ReadLine(); // Priming read, input before loop<br />
while (inValue != "-99")<br />
salesAmount = Convert.ToDouble(inValue);<br />
salesTax = salesAmount * INTEREST_RATE;<br />
Console.WriteLine("Please type in a sales amount.");<br />
inValue = Console.ReadLine(); // reassigns data in inValue to check in loop<br />
This is the math section of my program that I'm having the trouble with. The problem isn't in the math expressions themselves, but more in the placement to get it to do what I want.
I am using RichTextBox class to display some text, and then I want to syntax highlight whats written to it.
So, i use Find(...) to select required text and then use SelectionFont,SelectionColor to changle font/color of the words i need.
The problem is that when i type, i have to do this when the text changes, and i actually see how text gets selected and changes it's color, and that is very annoying...
So, my question is, how to solve this problem? Maybe i can somehow disable redrawing of control till i completely highlighted control or smthing like ?
We know that Delegate is a Functional Pointer. But i want to pass Member name as a variable to Delegates. The example given below.
*-------------------------------------------------------------------------- using System;
public delegate void MyFunction(int a, int b);
public static void Function1 (int x, int y)
public static void Function2 (int x, int y)
public static void Function3(int x, int y)
static void Main(string args)
int i = 1;
string Fstring = "Function";
for ( i=1; i<=3; i++)
MyFunction mObj = new MyFunction(@(nString));
In the above example, i am storing each function name into "nString" variable.
While creating instance, can i pass this variable name as a parameter. Because the variable name contains name of the function. Or i want to evaluvate the variable nString and execute the function name which i stored in "nString" variable.
If any solution or suggession please write to: email@example.com
I recently had a series of very good interviews with a company I was very excited about and was told I was the top candidate for the senior position. At the end of the interview I was given the assignment below and I was told to zip up the files and return them to the project manager for review when I was done. I was open in the interview that I had no experience in unit testing. I was assured this was no problem and I could omit that portion of the exercise. However, I opted to give it a shot - an opportunity to show I was a quick and willing learner when needed.
After I turned in the "assignment" to the project manager, I was told that after reviewing the code I would be passed over for the position.
I would be VERY appreciative of any feedback anyone might have as to what's wrong with my sample project? I have worked for the same small company for over 6 years and had no experience when I did, so I don't know if there's something I did that killed it for me. I bear no ill will to the company I interviewed for and I have removed any indications from any text that might indicate who the interview was with. But I still must continue to interview and if I'm doing something wrong, I want to nip it in the bud.
Please, don't spare my feelings, I would really appreciate some constructive criticism.
1) Read an ascii text file named “Hire_input.txt” that contains a list of numbers with values between 0 and 100, each number separated by a cr/lf
Sample input (Hire_input.txt)
2) Sort the numbers in ascending order and write the results to an output file named “Hire_Ascending.txt”. Format the file in the same manner as the input file (cr/lf delimiters).
Sample output (Hire_Ascending.txt)
3) Group the numbers by their value and produce a histogram list providing the count of how many numbers of each value were read. Write the output to a file named “Hire_histogram.txt”, formatted using cr/lf delimiters.
Sample output (Hire_histogram.txt)
1 – 1
6 – 2
12 – 1
22 – 1
54 – 1
• Name the program Hire_exercise.exe
• No user interface is required, the program will be run from the console should require no command line parameters to execute normally
• Assume that all files (input and output) will be found/created in the same directory as the program executes
• As part of the exercise, you are expected to write unit tests appropriate for the task.
• Use the development tools of your choice.
• You may not use any external libraries with the exception of standard I/O and a unit testing framework (if you choose).
• You may not use any built-in data structures such as lists, vectors, queues etc. You must build your solution using basic types such as integers, strings and arrays.
• You may not use any built-in sort or histogram functions.
• Please submit all available aspects of your work (source, buildfiles, executables, test input/output etc)
Haven't the foggiest idea what may have changed their mind so quickly. I looked through it, and it seems good to me. The only thing that I noticed that didn't follow the "Additional Notes" was the naming of the program to Hire_excercise.exe...
Last Visit: 31-Dec-99 18:00 Last Update: 21-Sep-21 5:25