Reference no: EM132169222
using html
9.19 An integer is said to be prime if it's greater than 1 and divisible only by 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not.
a) Write a function that determines whether a number is prime.
b) Use this function in a script that determines and prints all the prime numbers between 1 and 10,000. How many of these 10,000 numbers do you really have to test before being sure that you have found all the primes? Display the results in a <textarea>.
c) Initially, you might think that n/2 is the upper limit for which you must test to see whether a number is prime, but you need go only as high as the square root of n. Why?
Rewrite the program using the Math.sqrt method to calculate the square root, and run it both ways. Estimate the performance improvement.
Create a chat client and chat server
: Create a chat client, and chat server. The chat client must be able to communicate with other chat clients on separate computers on your local network.
|
Compute their time complexity in big-o notation
: Write an implementation for each operation and compute their time complexity in Big-O notation (no justification is needed).
|
Write an application that creates objects of each of class
: Write an application that creates objects of each of the three classes, places references to those objects in ArrayList .
|
Calculate the amount of county sales tax
: A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected.
|
Write a function that determines whether a number is prime
: Write a function that determines whether a number is prime. Calculate the square root, and run it both ways.
|
Create an automobile class for a dealership
: Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, vin number, miles per gallon, and speed.
|
Write down the bit pattern that would represent
: Using the IEEE 754 floating-point format, write down the bit pattern that would represent -1/4. Can you represent -1/4 exactly?
|
Create a text based version of the dice game button men
: Create a text based version of the dice game 'Button Men'. No Special dice are allowed. Each Player starts with a set of 5 dice.
|
Display the percentages next to the displayed words
: Input a second user-specified text file assumed to be a list of words, each on a separate line of text (no error checking for format).
|