homework

What is the difference between a Java API and a library?

I know that an API is called a set of functions used to call something, and a library is a collection of classes, but what is actually API in package like Java.lang? I can connect to a class like System without using any API here, so why we say as J2SE API rather than J2SE packages? ...

relations on sets need help asap on relations on sets

this my question i dont know what to do Let A = {1, 2, 3, 4, 6} and let R be the binary relation on A defined by“x divides y”. (x divides y if and only if there exists an integer z such that xz = y). i. Write R as a set of ordered pairs. ...

Minimum number of attributes in a primary key?

If the degree of an entity is 8, what is minimum number of attributes required to form the primary key? ...

How can I find all permutations of a string without using recursion?

Can someone help me with this: This is a program to find all the permutations of a string of any length. Need a non-recursive form of the same. ( a C language implementation is preferred) using namespace std; string swtch(string topermute, int x, int y) { string newstring = topermute; newstring[x] = newstring[y]; newstring[y] = t...

how to transfer required files from ftp server to local unix server?

Hi i have to transfer files whose names consists of two variables X, Y and they are in the directory ABC in ftp server to my local unix directory XYZ. after transfering files i have to go to local directory path and i should untar (input files are compressed files) them. one more thing i have to use username and pwd for connecting to ft...

The difference between a 'view' and 'base' relation

What is the difference between a 'view' and 'base' relation in database systems? ...

arrays and functions

my assignment requires me to write a function that reads in a title and return the corresponding fee to the calling function. if the title is not in the list, return -1.0. as per my previous question, im a noob on c++, and this is what i have got at the moment: struct eventType { string title; double fees; }; eventType even...

Finite machine interpreter

I'm doing formal method and one of the project is to create a finite machine interpreter using java.it needs to read NFA from a text file and then convert from NFA to DFA. It also needs to output DFA to a text file.Then it goes to run through the symbol input and process DFA showing result whether accept or reject. I don't have much of ...

How can a 9-bit micro operation field in a microinstruction be divided into subfeilds?

How can a 9-bit micro operation field in a microinstruction be divided into subfeilds? ...

Newbie: C++ destructor problem

I have to write a stack class template using arrays in C++ for my assignment. Here is my code. #include <iostream> template <typename Type> class Stack { private: int top; Type items[]; public: Stack() { top = -1; }; ~Stack() { delete[] items; }; void push(Type); bool isEmpty() const; Type pop(); Type peek() const; }...

Tough Logic- Help Please

Hello All, My TL asked me to implement this: If we have the alphabets in english numbered as a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 1 k 2 l 3 m 4 n 5 o 6 p 7 q 8 r 9 s 1 t 2 u 3 v 4 w 5 x 6 y 7 z 8 the vowels would be a 1 e 5 i 9 o 6 u 3 The User would enter : 1. Number of ...

Assignments on Javascript for beginers?

Can you suggest some good Javascript assignments/homework to C programmers, who are not much familiar with Javascript? They are strong in C, hence basic Javascript. I need few JS related assignments which I can assign to them, to help them understand Web-Dev and Prototype concepts. I'm not looking for the tutorials which they need to ...

How to generate all possible 3-chars strings in c# ?

The question is : How to generate a list of all possible 3-chars strings in c# ? ...

Shortest branch in a binary tree?

A binary tree can be encoded using two functions l and r such that for a node n, l(n) give the left child of n, r(n) give the right child of n. A branch of a tree is a path from the root to a leaf, the length of a branch to a particular leaf is the number of arcs on the path from the root to that leaf. Let MinBranch(l,r,x) be a simple ...

How can I convert a list of strings into numeric values?

How can I convert a list of strings (each of which represents a number, i.e. [‘1’, ‘2’, ‘3’]) into numeric values. ...

How do I write a proposal document for a software project?

I have to write a proposal document for my homework. It's about creating an offline message plugin for Liferay. I'm really confused about writing such a document. How should I write this? Is there an example proposal document available somewhere? (I'm afraid this question is "not programming related". Where could I ask it instead?)...

How to implement tertiary search in C?

Write tertiary search program. Notes: Tertiary search is similar to binary search. In binary search we consider two parts of the array and select one part as the next search space. In tertiary search we consider the array in 3 equal parts. For this, we take two "middle" indices, middle1 and middle2 respectively at 1/3 and 2/3 of the arra...

Pen Plotter Problem(find shortest path for pen to move to draw a diagram,java)

Before the advent of inkjet and laser printers, straight line drawings used to be plotted by coloured pens on large sheets of paper: the pens moved very slowly so this was a time-consuming process. Since time is money, it was important to draw figures in an optimal way, using minimum time. you will implement an A* search procedure for t...

Implementing the following with OCaml

I'm trying to implement the following with OCaml for a homework assignment: g(n) = y if n = x else f(n) so, for example if f(n) = n+1, x = 7, y=42, then g(1) = 2, but g(7) = 42 I've got: # let update f x y = f(x) = y;; val update : ('a -> 'b) -> 'a -> 'b -> bool = < fun> but I just don't know the syntax I should use in order to ...

accepting a grammar in C++

this is a lab assignment i am stuck on. i cant believe i am having problems with this basic programming, but i cant afford to waste any more time on this. i gotta ask the experts. i need to accept this grammar (ab)*b, which basically means any number of "ab" and ending with b. i have written this code but somehow, it checks only the fi...