Questions
write java program that prompt the user to enter two numbers .the program display all numbers...

write java program that prompt the user to enter two numbers .the program display all numbers between that are divisible by 7 and 8 ( the program should swap the numbers in case the secone number id lower than first one

please enter two integer number : 900 199  

Swapping the numbers

224 280 336 392 448 504 560 616 672 728 784 840 896

i need it eclipse

In: Computer Science

Write a C Program to finish the following requirements: Convert a double number to its hexadecimal...

Write a C Program to finish the following requirements: Convert a double number to its hexadecimal form

1. The double number x is located between 0 and 1000(0<=x<=1000),e.g.678.345

2.The double number with the hexadecimal form contains 6 significant digits. e.g." 5D.32FA45".

3.The double number with the hexadecimal form is represented by a string(or a character array), e.g."5D.32FA45".

Please write as simple as possible because I am a freshman in C! And please give me some clues!

Thanks!

In: Computer Science

Can someone fill in the blanks? using namespace std; double approxPi; // define the signal handler...

Can someone fill in the blanks?

using namespace std;

double approxPi;

// define the signal handler function
______
______
______
______
______

int main(int argc, char* argv[])
{
pid_t childPid;
double inside = 0;
double total = 0;
double oldPi = 0.0;
switch (childPid = fork()) { // fork the process
case -1:
cerr << "forking error";
exit(0);
case 0: // child process
// register SIGUSR1 handler
______
______
______

while (1) {
// calculate the approximate value of pi using the Monte Carlo method
for (int i = 0; i < 10000; ++i) {
double x = (double)rand() / RAND_MAX;
double y = (double)rand() / RAND_MAX;
if (x * x + y * y <= 1) {
inside++;
}
total++;
}
approxPi = 4.0 * inside / total;
}
default: // parent process
sleep(5);
______; // send the SIGUSR1 signal to the child
}
return 0;
}

In: Computer Science

Using a programming language of your choice, write a complete and fully functional program that uses...

  1. Using a programming language of your choice, write a complete and fully functional program that uses reference and pointer types to swap two double precision floating-point numbers. The two numbers are read in by the program’s user. Use a proper prompt for each number.
    1. Use one function that uses formal parameter reference types to swap the two numbers
    2. Use another function that uses formal parameter pointer types to swap the two numbers.
    3. In the main or driver function, call these two functions with the actual arguments received from the program’s user
    4. Display immediately the result of the swapping after each function call in the calling function (the main function or the driver) before the next function call to see whether the numbers are swappe Use a proper display message.

In: Computer Science

a. Design a binary-to-octal converter. b. Design a logic circuit by which the following arithmetic expression...

a. Design a binary-to-octal converter.
b. Design a logic circuit by which the following arithmetic expression can be calculated and show how X = 9 - 5
c. Write a short note on the data distributor circuit.

In: Computer Science

You plan to visit your dentist for an emergency. You will be required to follow a...

You plan to visit your dentist for an emergency. You will be required to follow a specific process before you can see your dentist. Write an algorithm and draw a flowchart for this problem.

In: Computer Science

FOR SAGE PYTHON Koch snowflake: The Koch snowflake can be constructed by starting with an equilateral...

FOR SAGE PYTHON

Koch snowflake: The Koch snowflake can be constructed by starting with an equilateral triangle, then recursively altering each line segment as follows: Step 1: divide the line segment into three segments of equal length. Step 2: draw an equilateral triangle that has the middle segment from step 1 as its base and points outward. Step 3: remove the line segment that is the base of the triangle from step 2. After one iteration of this process, the resulting shape is the outline of a hexagram. The Koch snowflake is formed by repeating this process over and over again (in principle, infinitely many times, but in practice we will stop after a certain number of iterations). Your goal is to write a program which draws the Koch snowflake, following these instructions:

(a) Don’t attempt to draw any lines yet, you should do that only at the very end. Instead, you should create a list of all vertices (points) which you want to connect in the end.

(b) Write a function, called koch_bump(), which takes as input two tuples (the coordinates of two points P = (x1, y1) and Q = (x2, y2)), and which returns a list of 4 tuples, starting with P and followed by the three points between P and Q which form the ”bump” pointing outwards from the line segment. Hint: Linear Algebra (vector geometry) can make this a lot easier, but you can also figure out the coordinates of the needed points using basic high school geometry

(c) Write a function, called koch_iteration(), which takes as input a list of tuples (think of these as the vertices of the equilateral triangle you start with), and which returns a new list of tuples which contains all points after applying the subdivision process exactly once. To do this, go through the given list of points, and apply the function koch_bump() to each two adjacent ones (don’t forget to also apply it to the last and first points in the list): For example, if the list contains the points A, B, C, you should call koch_bump() on the pairs (A, B), (B, C), and (C, A) — but you should write the function so that it can deal with an arbitrary number of points in the list.

(d) Write a function, called koch_snowflake(), which takes as input a list of tuples (the vertices of the starting polygon), an integer maxiter, and the optional argument filled (which defaults to False) and which produces the picture of the Koch snowflake obtained by applying koch_iteration() maxiter times, starting with the vertices given in the list. Hint: To connect a list of points (tuples) by line segments, you can use the polygon2d() command. Read its documentation, you probably want to use the options fill=filled,axes=False.

(e) Write a function, called regpolygon(), which takes as input an integer k, and which returns a list of k tuples which are the vertices of the regular polygon with radius 1. In other words, the k points should lie on the unit circle and should be evenly spaced apart. Hint: Use cos α and sin α, where α is a multiple of 2π/k.

(f) Draw the Koch snowflake after 5 iterations when starting with an equilateral triangle. Hint: Use koch_snowflake(regpolygon(3),5).

(g) Draw the Koch snowflake after 5 iterations when starting with a square.

(h) Draw the Koch snowflake after 5 iterations when starting with a pentagon.

(i) Repeat the last three parts, but with the option filled=True.

In: Computer Science

please provide example(s) how you have used excel to analyze data and share your results?? this...

please provide example(s) how you have used excel to analyze data and share your results??
this is more like a inteview question but i want to nniw its sample answer

In: Computer Science

java NetBeans Class Entry: Implement the class Entry that has a name (String), phoneNumber (String), and...

java NetBeans

Class Entry:

  1. Implement the class Entry that has a name (String), phoneNumber (String), and address (String).
  2. Implement the initialization constructor .
  3. Implement the setters and getters for all attributes.
  4. Implement the toString() method to display all attributes.
  5. Implement the equals (Entry other) to determine if two entries are equal to each other. Two entries are considered equal if they have the same name, phoneNumber, and address.
  6. Implement the compareTo (Entry other) method that returns 0 if the two entries have the same number, -1 if this.number is smaller than other.number, and + 1 if this.number is > other.number

Class PhoneBook

  1. Implement the class PhoneBook that has a city (String), type (String), entryList (an ArrayList of Entry).
  2. Implement the constructors to initialize the city and type.
  3. Implement the method addEntryToPhoneBook(Entry e) that adds an entry to the phone book.
  4. Implement the method toString() that displays all attributes and all enties information of the phone book.
  5. Implement the method displayAll() that displays all entries in the phone book.
  6. Implement the method checkEntryByNumber(String number) that takes a number and returns the entry with that number if it exists.
  7. Implement the method checkEntrisByName(String name) that takes a name, and returns an array list of the entries that start with this name or letters.
  8. Implement the method removeEntryFromPhoneBook (String number) that removes an entry from the arrayList of entires in the phone book.

Class TestPhoneBook

  1. Create a phone book and initialize its attributes.
  2. Add 5 entries to the phone book list using the method addEntryToPhoneBook()
  3. Display all entries in the phone book.
  4. Display the entry information for a given phone number if it exists. Give the appropriate message if it does not exist.
  5. Display all entries starting with the letters "Abd"
  6. Remove a specific entry from the phone book. Display the proper message if it was removed , or if it did not exist.
  7. Sort and display the entries of the phone book

In: Computer Science

Write a Problem analysis chart  & an algorithm, create an IPO and draw a flowchart for solving...

Write a Problem analysis chart  & an algorithm, create an IPO and draw a flowchart for solving a Quadratic equation.

In: Computer Science

does the exception handler run in kernel mode?

does the exception handler run in kernel mode?

In: Computer Science

2. Write a program to do the following: • ask the user to input the size...

2. Write a program to do the following: • ask the user to input the size of an array of integers and allocate space for the array • ask the user to input the integer values for the array and store these values into the array • calculate and display the sum and the average of elements of the array

In: Computer Science

Write a Little Man program that outputs the sum of n number of input values.

Write a Little Man program that outputs the sum of n number of input values.

In: Computer Science

Write a query that returns the department id and the number of employees (in the associated...

Write a query that returns the department id and the number of employees (in the associated department) salary is over $2500 and, at the end, result page has to show only department ids that have more than 5 employees in it. Please Note: (we don't interest all of department ids in our grouping action and also we don’t want to see any kind of total employee number in the result page we want to see limited result set)

Hint1: SELECT part has to be like below. SELECT department, COUNT(*) as "Number of employees"

Hint2: Don't forget the use of WHERE and please distinguish the WHERE and HAVING

SQL SCHEMA (oracle):
https://pastebin.com/raw/vaesFLWM

In: Computer Science

(Sort ArrayList) Write the following method that sorts an ArrayList: public static <E extends Comparable<E>> void...

(Sort ArrayList) Write the following method that sorts an ArrayList:

public static <E extends Comparable<E>>

void sort(ArrayList<E> list)

Write a program to test the method with three different arrays:

Integers: 2, 4, and 3;

Doubles: 3.4, 1.2, and -12.3;

Strings: "Bob", "Alice", "Ted", and "Carol"

This program is similar to the Case Study in the book: Sorting an Array of Objects

the language is in java

In: Computer Science