Archives

Java Programming – 95-707



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service
Java Programming – 95-707
Assignment A2
Due Date: Thursday June 15th

 

General Instructions:
Your classes should have main method that automatically executes the program (obviously)
Your classes should be named after the exercise name: Program1, Program2, …

Exercise Name: Program1

Write a Java application which reads bytes from the keyboard until encountering the # character. Echo each character to the screen as it is read. Terminate the program when the user enters the # character.

Exercise Name: Program2

Write a Java application that puts the following prompt on the screen:

Enter some text, terminate with #

Then it echoes each character that you enter.
When you press the Enter key. However, it doesn’t echo the # character.
When you enter the # character, the program terminates and displays your name.

Answer the following question on a separate sheet of paper:
Does your program insert extra blank lines? If so, can you explain why?

Exercise Name: Program3

Write a java application that wraps the value 3.14 in a Double object, and then displays two times the value using the doubleValue() method of the object.
Also have the application create a primitive double variable containing 3.14 and display twice the value contained in the variable without using a wrapper.
Provide appropriate text in the output. Also display your name on the screen along with a terminating message.

Exercise Name: Program4

Write a Java application that illustrates the use of member variables, local variables, and method parameters.
Make all of them type double.
Illustrate two different member variables: a class variable and instance variable.
Display each of them along with appropriate text, and also display a terminating message along with your name.

Exercise Name: Program5

Write a Java application that clearly illustrates the difference between the prefix and the postfix versions of the increment operator.
Provide a termination message that displays your name.

Exercise Name: Program6

Write a Java application that illustrates the use of the following relational operators: < > <= >= == !=
Provide appropriate text in the output. Also provide a termination message with your name.

Exercise Name: Program7

Write a Java application that illustrates the use of the following logical or conditional operators: && || !
Provide appropriate text in the output. Also provide a termination message with your name.

Exercise Name: Program8

Write a Java application that increments a counter from 1 to 10 and prints to the screen the successive values of the variable representing the counter.
Use a for-loop to iterate.
Provide appropriate text in the output. Also provide a termination message with your name.

Exercise Name: Program9

Write a Java application that increments a counter from 1 to 10 and prints to the screen the successive values of the variable representing the counter.
Use a while-loop to iterate.
Provide appropriate text in the output. Also provide a termination message with your name.

Exercise Name: Program10

Write a Java application that increments a counter from 1 to 10 and prints to the screen the successive values of the variable representing the counter.
Use a do-while-loop to iterate.
Provide appropriate text in the output. Also provide a termination message with your name.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Object Oriented Programming in Java



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Object Oriented Programming in Java
95-707
Revised 05/25/2000

Assignment A1

Due Date: Thursday June 8th

Description:


Write a Java application that will execute the following main method and display a date in the format “month/day/year” syntax followed by your name.

 

public static void main(String [] args) {

// instantiate object
MyDateClass obj = new MyDateClass();

//set date values
obj.setDate(5,25,00);

// display date
System.out.println(obj.getDate());

// display name
System.out.println(“your name”);

} // end main

 

Solution:

 

import java.util.*;

class MyDateClass { //define new type using keyword class

int month, day, year; // instance variables of the class


//instance method to store data
void setDate(int mo, int da, int yr) {

month = mo;
day = da;
year = yr;

}//end method setDate()

String getDate(){//instance method to get data

return “” + month + “/” + day + “/” + year;

}// end method getDate()

}//end class MyDateClass definition

//Driver program follows
class DriverProgram{ //define the controlling class

public static void main(String[] args){ //define main

MyDateClass obj = new MyDateClass(); //instantiate obj obj.setDate(5,25,00); //store data in instance variables
//display instance variables
System.out.println( obj.getDate() );
System.out.println(“My Name”);

}//end main

}//end DriverProgram class



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Object Oriented Programming in Java 95-707



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Object Oriented Programming in Java
95-707
Revised 05/25/2000

Assignment A1

Due Date: Thursday June 8th

Description:
Write a Java application that will execute the following main method and display a date in the format “month/day/year” syntax followed by your name.

 

public static void main(String [] args) {

// instantiate object
MyDateClass obj = new MyDateClass();

//set date values
obj.setDate(5,25,00);

// display date
System.out.println(obj.getDate());

// display name
System.out.println(“your name”);

} // end main



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

We want to manipulate polynomials in C++. A polynomial is a sequence of terms. a term is a pair (exponent, coefficient) where the exponent is a non-negative integer and the coefficient is a double-precision number. For example, we want to handle the polynomial:



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Assignment VI

Due date Dec. 8, 2004.

We want to manipulate polynomials in C++. A polynomial is a sequence of terms. a term is a pair (exponent, coefficient) where the exponent is a non-negative integer and the coefficient is a double-precision number. For example, we want to handle the polynomial:

5.3 x^3 – 1.2 x + 123.5

a) Write a class definition for a term. A single constructor is sufficient.

b) Write a class definition for a polynomial. Given that polynomials have an arbitrary size, the proper implementation is by means of a linked list, i.e. each term has a pointer to the next term.

c) Write a constructor for a polynomial, whose input is a term.

d) Write operators that add a term to a polynomial, and that multiply a term and a polynomial.

e) Write an operator that adds two polynomials.

f) Write a destructor for the polynomial class.

g) Write an output routine for polynomials, overloading the << operator. Assume that the name of the variable is X.

Test your code using any C++ compiler.You can:

Use g++ on omicron or any other unix machine at NYU, or
use Borland C++ on a machine in one of the PC labs, or
use gcc for your Windows95/98/NT/2000 or Linux machine at home.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

In this assignment you will build a simulation program to study the evolution of some ecological system



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Assignment V

Due date Nov. 22, 2004.

In this assignment you will build a simulation program to study the evolution of some ecological system. An ecological system includes a number of different organisms that have specific life-cycles and interact with others as predators or prey. The simulation consists in creating an initial distribution of these organisms, including their food supply, and studying how the population evolves over time. The assignment is open-ended: feel free to experiment and complete as much of it as possible. Your documentation should include a description of each class and its relationship to other classes in the system (no need for UML diagrams).

For this assignment we will consider a single type of organism, some marine invertebrate (let’s call it a blob) that feeds on plankton. The blob reproduces every so often, and the new blob is initially next to its parent (immediately to the left). Blobs move at random in one of eight possible directions, every second. After a number of reproductive cycles (around 10) a blob dies. A blob feeds on the plankton at its current location. The plankton at a given location replenishes itself in 5 seconds, so that if a blob appears at the same place before 5 seconds there is nothing for it to eat there. Two blobs cannot be in the same place at the same time, If a blob tries to move into an occupied space it tries to move in the opposite direction. If this also fails it stays put for this cycle. If a blob does not find food for 100 seconds it dies. To program this with threads, you need one thread to describe each living organism. Define the class Blob appropriately. Its run method is a loop that executes a number of moves and reproductive cycles. It terminates with old age or starvation, as described above. The state of the blob indicates how long ago it fed, how many times it has reproduced, and where it currently is. To make each blob behave independently, even though all of them have the same run method, use random number generators to determine where to move, when to reproduce, and how long to live.

A separate thread is needed to simulate the evolution of plankton. A thread scans the space of the simulation (which will be a rectangular grid) . To simplify things and not have to deal with actual times, we can simulate the regrowth of the plankton by scanning all the cells sequentially with pauses between cells, so that the whole scan takes 5 seconds, and marking each cell that is empty of plankton and unoccupied as full again.

The simulation takes place within a frame, and each blob updates the image by redrawing itself at a new position whenever it moves. A blob is represented by a colored circle, and a dead blob has a different color.

Feel free to experiment with the parameters of the simulation, to find out those that produce a more interesting effect!



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

In this assignment you will program a Java version of a simple toy of a decade ago: Simon



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Assignment 4

Due date: Monday November 8.



In this assignment you will program a Java version of a simple toy of a decade ago: Simon. In case you don’t recall, Simon consists of a number of buttons of different colors. The machine flashes the buttons in some random order (it also plays a note associated with each color, but we will ignore this feature for now). The player then recreates the sequence by pushing the buttons in the proper order. The sequences grow in length whenever the player succeeds, and the game stops when the player is unable to replay the whole pattern.
In our simplified version, we will use 4 buttons and a separate panel to display the sequence. When the machine displays a sequence, it changes the colors of the panel accordingly. Then it waits for input from the user, records the buttons that the user pressed, and compares them with the sequence it just played. If the sequence matches, the game continues with a longer sequence. If the sequence doesn’t match, the program indicates the length of the longest successful sequence, and asks the user whether it wants to play again.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

We discussed in class the problem of writing a general-purpose integration routine in Java. In this assignment you will complete the sketch we outlined, and add some graphic frills to it.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Assignment 3

Due date: Monday October 18.



We discussed in class the problem of writing a general-purpose integration routine in Java. In this assignment you will complete the sketch we outlined, and add some graphic frills to it.

We want to define a class Integrators that exports several integration methods. For this assignment you only have to write one, the simplest one: Simpson’s method. This method reduces the problem of computing the area under a function f (x) between a and b to the sum of the areas of vertical strips of equal width dx. The area is given by the formula:

[(f(a) + f(b)) / 2 + Sum (f (a + n*dx)) ] * dx, for n = 1, 2,.. (b-a)/dx-1

The precision of the method depends on the choice of dx. Taking 1000 steps will be good enough for this exercise, so choose dx = (b-a) / 1000, but feel free to experiment.

a) The integration method takes three parameters: an interface type and two doubles that specify the bounds. You want to define the interface type so it is easy to create an instance of it for any function you want. For example you can test your integration routine with the trigonometric Math.sin and verify that its integral from 0 to pi equals 2 (you can expect some roundoff errors depending on the number of steps you use).

b) The interface type (let’s call it Evaluator, in analogy to the Comparator interface we have used to sort) can also be used with a function that you write explicitly. For example, you should verify that the integral of 1 / (1 + x*x) between 0 and 1 is (about) pi/4.

c) Find a reasonable way of handling functions such as 1/(1-x) when integrated between -2 and 2.

In the next assignment, we will add a graphical component to this program, and display a graph of the function that is being integrated.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

To prepare for this discussion, please read Chapter 5 of your textbook (Feenstra, 2013). In addition, read Judgment under Uncertainty: Heuristics and Biases (Links to an external site.)Links to an external site.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

To prepare for this discussion, please read Chapter 5 of your textbook (Feenstra, 2013).  In addition, read Judgment under Uncertainty: Heuristics and Biases (Links to an external site.)Links to an external site. (Tversky and Kahneman, 1974).  Finally, review Instructor Guidance and Announcements.  In this discussion, you will consider judgment and decision making.  Be sure to use your own academic voice (Links to an external site.)Links to an external site. and apply in-text citations (Links to an external site.)Links to an external site. appropriately throughout your post. Locate an additional peer-reviewed source to support your ideas.

  1. Outline one of the following options:
    • Identify an example (not from the textbook) to illustrate one of the following heuristics: availability heuristic and representativeness heuristic, or affect heuristic.  Examine the use of heuristics.  How are our judgments, including attitudes and behaviors, influenced by social and cognitive factors?
    • Identify an example (not from the textbook) to illustrate one of the following errors in judgment: belief perseverance, confirmation bias, or illusion of control.  Examine errors in judgment.  How are our judgments, including attitudes and behaviors, influenced by social and cognitive factors?

Post your initial response of 250 words or more by Day 3 (Thursday).



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Review the instructions for your Final Paper located in Week Six of your online course.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Review the instructions for your Final Paper located in Week Six of your online course. As part of your Final Paper, you are asked to research and identify solutions implemented at five other hospitals in the U.S. that were dealing with the same issues. Create an outline illustrating five solutions implemented at five other hospitals, including key details.  Use the “Guide to Creating an Outline”Preview the documentView in a new window for assistance.

Your outline must be formatted according to the guidelines as stated in the Ashford Writing Center (Links to an external site.)Links to an external site..  Your paper must be two to three double-spaced pages (excluding title and reference pages) and formatted according to APA style as outlined in the Ashford Writing Center (Links to an external site.)Links to an external site.. Including the textbook, utilize a minimum of five scholarly and/or peer-reviewed sources from the Ashford University Library published within the last five years. Document all references in APA style as outlined in the Ashford Writing Center APA Checklist (Links to an external site.)Links to an external site..

Carefully review the Grading Rubric (Links to an external site.)Links to an external site. for the criteria that will be used to evaluate your assignment.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Do cultural dimensions correlate with purchase decisions? In this report, you will set out to address this question.



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service

Do cultural dimensions correlate with purchase decisions? In this report, you will set out to address this question. USING THE SPSS SPREADSHEET YOU SUBMITTED LAST WEEK, you will create an empirical journal article, much like the one you critiqued as your Unit 3 Individual Project.

THE REPORT:

  1. Provide a general research background on consumers’ motivation to buy.
    This portion of your paper will be 1 -2 pages in length and must be based predominately on articles from the library’s full-text databases. 
  2. Describe the data collection process. (This may be taken from the U4 Group project, as long as it is written in 3rd person).
  3. Demographic Charts & Tables:
    • Pie Chart for Gender (add a written description below it)
    • A chart for Age (add a written description below it)
    • Descriptive Statistics of the 6 Factors (add a written description below them)
  4. Four (4) Hypothesis Tests (one of which must be a regression)
    • Write out a Null & Alternate Hypothesis (alpha = .05)
    • Run the test, state the decision rule
  5. Apply the research to the findings of your study. What are the implications for marketers?

The assignment requires the use of ARTICLES from the library’s full-text databases. Articles are found in periodicals. These are not to be confused with eBooks or Reference Books. The best databases for Marketing: ABI Inform Global, Academic Search Premier, Business Source Premier, Masterfile Premier, and PsycArticles (in some cases). You should steer away from databases that focus on Books, including reference books, like: Credo Reference, eBrary, NetLibrary, or Oxford Reference.

Your report MUST include a reference list. All research should be cited in the body of the paper. In-text citations and corresponding references should be included in your paper.

The paper should be written in third person; this means words like “I”, “we”, and “you” are not appropriate. Instead of saying, “I researched and found out…” refer to yourself in the following manner: “The research team surveyed 5 people…”

Your assignment should contain a cover page, an abstract page and a reference page in addition to the body. The length of the submission depends on the size of the graphics used.

  • Please submit your assignment as a Word document in APA format using the attached TEMPLATE Below 
  •  https://class.aiuniv.edu/LCMSFileShareCommon/cb9/e70/214/edd/418/79a/825/e99/933/aee/e3/MKT655_U5IP_6.zip

In order to receive credit for work completed in SPSS, you must submit the .sav worksheet and the .spo file(s) used to create tables, graphs and output pasted in the U5 IP.

 



Click here to order this paper @Superbwriters.com. The Ultimate Custom Paper Writing Service