homework

How do I pass data between pages in PHP?

So in a nutshell on "page1.php" I have a calculator that consists of an html form, and then the php code totals the input and displays the total price. Below the price, it also displays a link to "page2.php" which contains an html form where they can enter their contact information and upon submitting the form the selections they made on...

Reading data from a file

I'm doing an exercise where I store coordinates into a .txt file called mydata, and then read it back from that file. However, I"m having trouble reading it back. code: #include "std_lib_facilities.h" // Classes---------------------------------------------------------------------- struct Point{ Point(int a, int b):x(a), y(b) {}; Poin...

80x86 assembly question

I have this code : section .data Foos: mov ecx,7 mov edx,5 L: inc edx sub ecx,1 setZ al ; set al to 1 if zero flag, otherwise al=0 shl al,1 mov byte[L1+1],al L1: jmp L lmp L mov eax,edx ret The question is what will be in eax at the end of the code? I don't know why the answer is 12? ...

Standard input and output

This is the code how can be solve struct Tool { FILE *in; FILE *out; }; int main() { Tool *t; t->in=stdin; t->out=stdout; Tool_sendcmd(Tool *tool,"SET VARIABLE value %d",3); } void AGITool_sendcmd_nav(TOOLS *tool,char *command, ...) { va_list ap; char buffer[1024],*str; va_start(ap,command); ...

assembly 80x86 question

i have this question: in 80486 computer what is the worst case (include the FETCH) number of memory access of the instruction: add dword [x],0x123FA4 if it known that an opcode with no operands is 2 byte len ...

Interfaces in a relational UML diagram inspired by SO

I have developed my homework from the post. Problem: to do posts similarly as in SO so that the first post is the question and the other posts are replies after the question. Question: How would you improve the interfaces? Would some simpler data structure make things easier? ...

C++ array excercise-help needed

Hello, I'm C++ begginer. I did this excercise from Deitel's book: Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100, inclusive. As each number is read, validate it and store it in the array only if it is not a duplicate of a number already read. After read...

Problem with random dice rolling in C# console application

I am writing dice roller program in C# console. I am giving two input Enter the size of the dice and Enter how times you want to play. Suppose dice size is 6 and 10 times i have played. Output is coming: 1 was rolled 2 times 2 was rolled 7 times 3 was rolled 8 times 4 was rolled 7 times 5 was rolled 4 times 6 was rolled 5 ...

Counting vowels using switch

I'm new to C#. While learning it, I tried to design a program which count the vowels in a sentence. In my code, I used the "foreach" statement with the if-else if statement. I would like to convert these line of code using the switch statement but I'm not really sure where to go. Do I need to add a new method? I would appreciate your h...

Some Questions on Complexity

1) Reorder the following efficiency from smallest to largest: 2^n, n!, n^5, 10000, nlog2(n) My Ans-> 10000 < nlog2(n) < n^5 < 2^n < n! Correct ? 2) Efficiency of an algo. is n^3, if a step in this algo. takes 1 nanosec. (10^-9 sec.). How long does it take the algo. to process an input of size 1000? I don't know ... Is it (...

Given a total, determine how many times a value will go into it

The Problem: A box can hold 53 items. If a person has 56 items, it will require 2 boxes to hold them. Box 1 will hold 53 items and box 2 will hold 3. How do i repeat the above where 53 is a constant, unchanging value and 56 is a variable for each box: Math.Ceiling(Convert.ToDecimal(intFeet / 53)) what i have so far that is: int Tota...

Is there away to generate Variables' names dynamically in Java?

Let's say that I need to generate variables to hold some input from the user (I don't know how many they are). Without using Array, ArrayList (and other kind of lists and maps) can my code generate (lets say) String variables X times with names like (String var001, String var002, String var003, etc)? If yes, please provide sample code. ...

Which type cannot be used as Generics

Which type cannot be used as generics? ...

Events in counting vowels

I'm wondering what event/events is/are being used in counting the vowels while you're typing the sentence in the textbox. I'm not quite sure if it's something to do with "KeyPress" or "KeyUp". I would appreciate your help. ===== This is now where I'm stucked: private void textBox1_TextChanged(object sender, EventArgs e) { ...

simple chat application c# winforms

Hi I need a simple chat application using c# winform. How do i start? is there any sample available for this? Regards, Nagu ...

Debugging Error

I think the problem is an access violation but I just can't seem to find it. Here is the function. // Structure struct TestScores { char Name[40]; // Student name int Idnum; // Student ID number double *Tests; // Pointer to an array of test scores double Average; // Average test score char Grade; // Course grade...

Can this PHP code be improved?

Is there a better way to do this simple task below? Like with an array or even another method? <?PHP // current way if ($city != NULL) { $city = FilterALLHTML($city); } if ($state != NULL) { $state = FilterALLHTML($state); } if ($title != NULL) { $title = FilterALLHTML($title); } if ($division != NULL) { $division = Fil...

how to delete every n-th char in file (via batch or vbs)?

Hello, how can I delete every n-th (4000th) char (space character) in a file (.txt or .sql) best via batch or vbs? Thanks in advance! ...

Submitting a Form using PHP and AJAX via jQuery

So I am using "load" functions of jQuery to use ajax on my pages. Can anyone write a small snippet of code using jquery load (or any ajax function which you think is the best) ? What I do is make a form, onsubmit pass to js, further using GET pass values into the load function and return false; though this works I am sure this is not th...

Relation between object file and shared object file

what is the relation b/w shared object(.so) file and object(.o) file can you please explain via example Thanks in advance ...