Questions: 1 835

Answers by our Experts: 1 539

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

I am getting a "Must declare Scalar Variable" runtime error in my c# windows Form application. I have set all the variables and parameters for the SQL insert statement but continue to get the error. What should I be looking for to solve the issue.
I have two forms, when I click a button on my first form it closes it and opens the 2nd form. However, when I click the default 'X' in the top right corner of the form to close it, it closes but the program's process are still left running in the background. How can I fix this to completely close the program as well?
my code shows me error
echo: write error: Bad file descriptor
when i execute echo hi | wc

this is my code:

void execute_commands(struct command mycommands[], int no_commands)
{
int i;
int *arr[no_commands-1];
for (i=0; i<no_commands-1; i++)
arr[i] = (int *)malloc(2 * sizeof(int));
for (i=0; i<no_commands-1; i++)
pipe(arr[i]);
for( i = 0; i < no_commands - 1; i++)
execute_command(mycommands[i].comm, mycommands[i].no_args, mycommands[i].args, arr[i][1], arr[i][0]);
}
int execute_command(char *command, int argc, char *args[], int fd_in, int fd_out )
{
pid_t pid;
int child_status;
if ((pid = fork()) == 0){
if (fd_in != -1) {
dup2(fd_in, 0);
close(fd_in);
}
if (fd_out != -1){
dup2(fd_out, 1);
close(fd_out);
}
execvp(command, args);
exit(0);
}
else if (pid > 0){
if (fd_in != -1) close(fd_in);
if (fd_out != -1) close(fd_out);
waitpid(pid, &child_status, 0);
}
else {
fprintf(stderr, "Error in creating a child process!\n");
exit(-1);
}
return 0;
}
I have the following toString method which returns 'result' into a textbox

result += "Driver: " + a.getForename() + " " + a.getSurname() + " (" + a.getOccupation() + ")" + "\r\nClaims: " + a.countClaim() + "\r\n";

I want the Claims: (count), to be aligned to the right side of the text box, how can I do this without aligning everything else?

Example:
Driver: (firstname) (surname)(occupation) ...............................Claims: (count)
What is the difference between .Show(); & .ShowDialog();
I want the user to enter a word in my application, but I want it to follow these rules:

• Word starts with a vowel
• Has a length of 5 – 8 characters
• Must have at least 1 repeating letter

How can I check for these in my program? (not case sensitive)
User entered firstName at the start of the program. This part allows them to then search the name they entered, but it is case sensitive, so if I entered 'James' for the name and then search 'james', it doesn't display info. How do I fix please?

Console.Write("Search for a student: ");
string searchedName = Console.ReadLine();

for (int i = 0; i < studentSize; i++)
{
if (firstName[i].Contains(searchedName))
{
Console.WriteLine();
Console.WriteLine("Name: \t\t\t" + firstName[i] + " " + lastName[i] + "\n" + "Maths Mark: \t\t" + maths[i]
+ "\n" + "English Mark: \t\t" + english[i] + "\n" + "Science Mark: \t\t" + science[i] + "\n" + "Average Mark: \t\t" + average[i]);
}
}
When the game begins the user should be welcomed to the application and given basic instructions. There should be an option for the user to be able to enter and store a number of words that conform to these rules:
• Word starts with a vowel
• Has a length of 5 – 8 characters
• Must have at least 1 repeating letter.

Valid words get added to an array.
The program then should choose a word at random from the bank of words.
Windows Form App:

When the game begins the user should be welcomed to the application and given basic instructions. There should be an option for the user to be able to enter and store a number of words that conform to these rules:
• Word starts with a vowel
• Has a length of 5 – 8 characters
• Must have at least 1 repeating letter.

Valid words get added to an array.
The program then should choose a word at random from the bank of words.
The user is invited to enter a word and have it checked. Any letters that are identified correctly should be indicated to the user.
The game should continue until the user decides to exit.
write a C++ program to implement an algorithm that generates the factorial representation of a natural number k. output to console the factorial representation of k. Take advantage of repeated division rather than seeking the largest t! less than or equal to k and then having to worry about whether you need any leading zeros.

then write a C++ program that generates the permutation of rank k in the lexicographic order of the permutations of an n-set. You must first prompt the user for the value of n, then for value(s) of k. Call this program LexRank2Perm. Remember to use the alphabet for the elements of your permutation. Your code the first question provides the first step in this process. and Write a C++ program that generates all permutations of an n-set using the Johnson-Trotter algorithm. output one permutation per line. Clearly run for small values of n given how quickly n! grows. Don't forget to use a, b, c, ... as the symbols permuted.
LATEST TUTORIALS
APPROVED BY CLIENTS