homework

help with basic tic tac toe program

i've never been this frustrated in my life. cant even do the basics here.. just need to make a simple tic tac toe program. i feel so alone in this world right now.. i get the basic idea, but can't put it together logically. Class instance variables: private char[][] board; private char player; // 'X' or 'O' Methods: public TicTacT...

selection sort in assembly language

Hey guys, here is my code.. I have to perform a selection sort on an array. It is homework. The Irvine32.inc sets up my memory model. Any suggestions to what I'm doing wrong would be helpful. I've redone the entire thing a few times now. INCLUDE Irvine32.inc .data myArray DWORD 10, 12, 3, 5 .code main PROC call Clrscr MOV EDI, ...

when is it inappropriate to reuse program code?

I cant find a good answer for this question! Thanks in advance! ...

Why are distributable systems more scalable then centralized systems?

Why are distributable systems more scalable then centralized systems? And What practical limit to the scalability can occur? Thank you very much in advance!!! ...

JAva beginner having trouble writing a method to get cost

//create a method called costOfRecordCollection that will return the cost of all the CDs in the ArrayList hi, i'm stumped on the above method at the moment (new to java programming) - this is what i've written so far but don't know if i'm on the right track. any assistance/direction appreciated. Pieter. public void setcostofRecordCol...

Construct a DFA for the following language: all strings that have at least three 0s and at most two 1s.

Hello, I am to construct a DFA from the intersection of two simpler DFAs. The first simpler DFA recognizes languages of all strings that have at least three 0s, and the second simpler language DFA recognizes languages of strings of at most two 1s. The alphabet is (0,1). I'm not sure how to construct a larger DFA combining the two. T...

Making a 4-bit ALU from several 1-bit ALUs in VHDL

Hey, I'm trying to combine several 1 bit ALUs into a 4 bit ALU. I am confused about how to actually do this in VHDL. Here is the code for the 1bit ALU that I am using: component alu1 -- define the 1 bit alu component port(a, b: std_logic_vector(1 downto 0); m: in std_logic_vector(1 downto 0); result: out std_logic_vector(1 downto ...

SQL and PHP database access

I'm very new to PHP, SQL I've worked with using Coldfusion but only with very simple queries. In coldfusion to access a specific database <cfquery dbname="blah"> I know in PHP I have to use mysql_query() and mysql_connect(), and here is the code I have, so I understand how to access a server and a table, but not the database. How can ...

Intensional and extensional definition of sets

Hi, I am searching for a extensional definition for the following set: E := { m | m subset {a,b,c,d} and |m| = 2} My idea is E := {{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d}, {a,a}, {b,b}, {c,c}, {d,d}} any ideas? ...

In what case can requirements for security and availability be a problem for the system architecture?

Thanks in advance! ...

validating user input

I am almost done with this but there are 2 things that are stumping me in my code. When I query a user for the test score, if the score is not within the 0-100 range, I want to not accept it and then tell them why and ask for another input. I also want to print the letter grade for their average next to their average score. For some reas...

Implementation of Fermat's primality test in Java

Who wants to help me with my homework? I'm try to implement Fermat's primality test in Java using BigIntegers. My implementation is as follows, but unfortunately it doesn't work. Any ideas? public static boolean checkPrime(BigInteger n, int maxIterations) { if (n.equals(BigInteger.ONE)) return false; BigInteger a; ...

Is it possible to develop a web site for a touch based browser without using HTML5 or CSS3?

I'm developing the CSS file for the mobile version of the website my group are working on for our web design coursework, and I was wondering if it was possible to design a site for touch based browsers using the currently ratified specification of HTML and CSS, as the other member are doing for the desktop variant, or am I going to have ...

PHP Output of SQL Query

As of now I have no errors in my program, but I need the primary key for one of the tables for a relation for the following Query. but instead of getting a actual number the value the query is sending back is Resource id #4 Here is my Code: (The query that I'm having issues with is the $sql_branch, is there a function to change the resu...

Simplify this python code

I've written a program to check if my thought about solution on paper is right (and it is). The task: how many zeros is in the back of multiplication of all numbers from 10 to 200. It is 48 and it is a simple to calculate manually. I never write on python seriously and this is what I get: mul = 1 for i in range(10, 200 + 1): mul ...

PHP query output of SQP

I have no actual php errors, but When I make my query this I get output : $sql_result = "SELECT AuthorFirst, AuthorLast, OnHand, Title FROM Inventory i, Wrote w, Author a, Book b WHERE i.BookCode = b.BookCode AND i.BookCode = w.BookCode AND a.AuthorNum = w.AuthorNum AND 2 = i.BranchNum"; When ...

Problems organizing/creating classes for Game of Nim

This particular variant of Nim involves: Two players alternately take marbles from a pile. In each move, a player chooses how many marbles to take. The player must take at least one but at most half of the marbles. Then the other player takes a turn. The player who takes the last marbles loses. I need to: - Write a program in which a hum...

Using string taken from Scanner not working?

When I run the program and enter a rank & gender it yells at me and tells me it is an invalid gender. I cannot see why if I enter "male" into the console, it does not equal the string "male"? Can please explain to me why this doesn't work and perhaps some suggestions on how to fix it? Thanks! import java.io.File; import java.io.IOEx...

C++ How to create a dynamic array of integers

C++ How to create a dynamic array of integers using new Keyword ? ...

Scanner fractionSum problem finishing part

I need to write a method where the parameter accepts an interger (n in this case) and returns the sum of the first n terms of the sequence as a double value. So say I put fractionSums(5); the output would be 1+...+1/5 which would then equal to something like 2.8333~.(final result) what I have now is: public static void main(String[] ...