homework

Find the closest server in the network

Given a list of servers & a list of clients, how to find a server that is closest to a particular host using "traceroute"? The program should be in java. ...

A way of checking if the digits of num1 are the digits in num2 without checking each digit?

Lets say I have guessed a lottery number of: 1689 And the way the lottery works is, the order of the digits don't matter as long as the digits match up 1:1 with the digits in the actual winning lottery number. So, the number 1689 would be a winning lottery number with: 1896, 1698, 9816, etc.. As long as each digit in your...

Order of Precedence with methods?

Say I have 2 methods. One is an method triggered by the selected index changing in the listbox. The second method helps by clearing all textboxes, setting listbox index to -1, and setting the focus. Question: Method two executes, during the code it changes the selected index of the listbox to -1, thereby setting off the event trigger ...

dividing two Ints inside a double variable in C++

I am working on a lab for school that runs 10 trails of 10000 5 card hands , I have to find flushes and pairs in each hands. I have to find the percentage of pairs and flushs per trail. my problem is when I try to get the percentage of a pair of one trail for example double percent = total_pairs/10000; or double percent = 5600/10000...

How to program a schedule...

Hello! I have to build a program that schedules based on certain rules. I'm not sure how to explain it, so let me give you an example.. You have Five People A,B,C,D,E. And you Have another set of people S1 S2 S3 S4 S5 S6 S7. If A B C D and E are available every hour from 9 to 5, and S1 S2 S3 S4 S5 S6 and S7 have a list of 3 people they...

Question on moduli

Hi, I want to find all the numbers divisble by all the numbers between 1 and 5. how do I write the program so that if the remainder of 'start' divided by all the numbers that x goes through is equal to 0 that it will print start. Is there any syntax that will calculate what I'm looking for. thanks. import math def main(): one = 1 ...

Basic RDBMS design and schema creation in Oracle

Hi, I have to create a entire application in an Oracle RDBMS with SQL. The Design includes to complete full entity-relationship and also design the relevant Schema with object creations.Important is-When creating schema and objects..we should fully apply normalisation. Also, writing all the relevant SQLs in each and every step in this p...

C# file stream - build a quiz

Hello Friend Were trying to use external file (txt or CSV) in order to create a file stream in C#. The data in the file is that of a quiz game made of : 1 short question 4 possibles answers 1 correct answer The program should be able to tell the user whether he answered correctly or not. I'm looking for an example code/algorithm/tutor...

How to remove elements from array but effectively shift down everything else in the array?

Given a file compact.txt that contains no more than 100 integers greater than 0, you need to read the file into an array, then traverse the array removing all the zeros keeping the original order of numbers in tact. And below is my unfinished code. import java.io.File; import java.util.Scanner; public class CompactUtil { private st...

C Preprocessors - for homework

I am not understanding this question...can you tell me what to do in a short message...or give me some links to search....please, it's urgent You are required to implement a C preprocessor. The Preprocessor is to be implemented as a command-line tool, the input to which is a C source file (.c extension) and the output is the preprocesse...

Constructor for class

Arrays in C/C++ of N elements have subscripts from 0 as the lower bound to N-1 as the upper bound. Other languages like Pascal allow the user to specify any lower bound and upper bound subscript values to create an array of (upper bound - lower bound + 1) elements. Question: Create a class "Array" in C++ that allows a user to specify bo...

Operator overloading in C++

I have the following constructor in my "fraction class" fraction::fraction(int num, int den=1) { numerator=num; denominator=den; } I also have a function called lcm() that returns the least common multiple of values given as parameters. I need to overload the "+" operator in the class fraction. The operator "+" is to add t...

Adding Java Objects to database

For this university assignment I have a Prize object which contains either text, Image, Video. I would like to save this information into a Blob field in a database which will be running on a PDA on Apache Derby. How can i add this data to the database? Thanks in advanced. ...

html regex c#

I want to load an url as a string, and then use regex to write out matches in c#. ...

How do I select titles from a mysql DB that begin with a specific letter?

I need to make an alphabetical listing of movie titles, so I need to show only items that begin with a chosen letter. To make this slightly more complicated, many titles start with "the" or "a", which needs to be ignored. How would the mysql query look to achieve such a task? I could simply have an extra column with the search letter s...

Problem setting output flags for ALU in "Nand to Tetris" course

Although I tagged this homework, it is actually for a course which I am doing on my own for free. Anyway, the course is called "From Nand to Tetris" and I'm hoping someone here has seen or taken the course so I can get some help. I am at the stage where I am building the ALU with the supplied hdl language. My problem is that I can't get ...

how to print a string vertically in c?

Ok the output is supposed to look like this: ./a 3 4 8 2 3 4 8 2 This is what I have so far, but I am lost and can only get the first integer to print (we have to use GetInt, which gets the specified integer in the string): int main (int argc, char*argv []){ int v; int i; i = 1; v = GetInt(argc, argv...

Evenly divide in c#

In c# how do I evenly divide 100 into 7? So the result would be 16 14 14 14 14 14 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling(100d / vals.Length); } Is there...

C# Homework - control structures (for, if)

I got a homework assignment today: "Create a program that calculates out how many ways you can add three numbers so that they equal 1000." I think this code should work, but it doesn't write out anything. using System; namespace ConsoleApp02 { class Program { public static void Main(string[] args) { ...

How to go about serving a singleton object over the network in C#?

I am creating a card game in C# for a school project. This card game is networked. The card game's game data is stored in a singleton object as gameData. gameData holds, the player names, which player the game is waiting on, player objects. Each player has 3 List objects. Where the cards are again custom objects. Originally I was going t...