Questions
Virtual Reality What is the basic purpose of this technology? In what types of mobile applications...

Virtual Reality

  • What is the basic purpose of this technology?
  • In what types of mobile applications can this technology be effectively used and why?
  • What are the pros and cons of this technology?
  • Are there any other important aspects of this technology that should be provided?

In: Computer Science

Objectives: Learn to analyze a computational problem and construct an algorithm to solve it Learn to...

Objectives:

  • Learn to analyze a computational problem and construct an algorithm to solve it

  • Learn to use sequential statements to build a basic program to implement the algorithm, using correct programming format

  • Learn to use the scanf function to read and store values entered on the keyboard by the user, and the printf function used to display output results on the computer monitor

  • Learn to convert math formulas into correct arithmetic expressions using variables, constants, and library math functions

  • Learn to construct a test plan and provide appropriate documentation

Description: This programming assignment requires you to compute the number of helium-filled balloons of a specified diameter required to lift a person with a specified weight off the ground.

Instructions:

  • Inputs: The required input values to be provided by the user are the weight of the person in pounds (a double), and the diameter of each balloon (an integer). Assume the balloon material is foil/mylar. Other values needed (a value for pi, for example) should be defined as constants.

  • Output: Display all input and computed values, including “explanatory text”. The final output value to be displayed is the number of balloons required (an integer).

  • Formulas: Show all formulas used for this problem, with explanations, units, and any helpful sketches. You will need the formula for computing the volume of each balloon (assume a perfectly spherical shape, ignoring the air valve), and some basic facts about helium:

o Volume of a sphere: v = 4/3πr3

o Facts about helium: Less dense than regular air, helium weighs 0.0114 lb/ft3 due to the force of gravity pulling down. The air pushes up with a force equal to the weight of the air the helium displaced, or 0.0807 pounds. The difference between the up and down forces is 0.069 pounds, and as a result, each cubic foot of helium can lift 0.069 pounds.

Identify values that would be valid vs. invalid for computing the number of balloons

(although you will not include testing of invalid values in this lab). Identify any known factors disregarded.

  • Algorithm: Document your algorithm, numbering the steps.

  • Example solution: Compute the solution by hand using your algorithm and example values. You may use the following example values for testing:

o 100 lbs for the weight of the person

o ? in. balloon (class suggests)

  • Testing: Document your test plan. After you construct your program, test it using the same example values as used in the example solution and include screenshots of the output in your report.

Scoring: Your grade for this assignment will be determined by five criteria:

  1. Do your programs compile and run, producing the correct results according to the instructions?

  2. Do your programs demonstrate good programming practices, such as well-documented code with comments, effective use of white space, proper indentation, appropriate variable names, etc.?

  3. Have you tested your programs as instructed and included screenshots of output results?

  4. Have you submitted a completed Lab Report?

  5. Are you submitting your assignment on time?

In: Computer Science

I need this in java on textpad. There are two files, both have instructions in them...

I need this in java on textpad. There are two files, both have instructions in them on what to add in the code. They are posted below.

public class MyArrayForDouble {
double[] nums;
int numElements;
public MyArrayForDouble() { // Constructor. automatically called when creating an instance
numElements = 0;
nums = new double[5];
}
public MyArrayForDouble(int capacity) { // Constructor. automatically called when creating an instance
numElements = 0;
nums = new double[capacity];
}
public MyArrayForDouble(double[] nums1) {
nums = new double[nums1.length];
for(int i=0;i<nums1.length;i++)
nums[i] = nums1[i];
numElements = nums1.length;
}
void printArray(){ // cost, times
System.out.printf("printArray(%d,%d): ",numElements,nums.length);
for(int i=0; i<numElements;i++)
System.out.print(nums[i]+" ");
System.out.println();
}
int linearSearch(double val) {
for(int i=0;i<numElements;i++)
if(nums[i] == val)
return i;
return -1;
}
int binarySearch(double val) {
int start = 0;
int end = nums.length - 1;
int mid;
while(start <= end) {
mid = (start + end)/2;
if(val == nums[mid])
return mid;
else if(val < nums[mid])
end = mid-1;
else // val > nums[mid]
start = mid + 1;
}
return -1;
}
private void enlarge() {
// double up the size of nums;
double[] new_nums = new double[nums.length*2];
for(int i=0;i<numElements;i++)
new_nums[i] = nums[i];
nums = new_nums;
}
void add(double val) {
if(isFull()) // if(numElements == nums.length)
enlarge();
nums[numElements] = val;
numElements++;
}
public void addOrder(int idx, double[] valArray) {
// add all elements of valArray from the specified position of nums.
// need to keep order
// eg) [10,20,30] --> addOrder(1,{1,2}) makes {10,1,2,20,30}
ensureCapacity(numElements + valArray.length);
// Here we can safely assume 'nums' has at least 'numElements + valArray.length' spaces
for(int i=numElements-1; i>=idx ; i--)
nums[i+valArray.length] = nums[i];
for(int i=0;i<valArray.length;i++)
nums[i+idx] = valArray[i];
numElements += valArray.length;
}
private void ensureCapacity(int count) {
if(count <= nums.length)
return;
// need more space
double[] new_nums = new double[count];
for(int i=0;i<numElements;i++)
new_nums[i] = nums[i];
nums = new_nums;
}
int remove(double val){
// search for an element that is equal to val. and remove it from 'nums'
int idx = linearSearch(val);
if(idx < 0)
return 0;
// fill the location with the last element
nums[idx] = nums[numElements-1];
numElements--;
return 1;
}
// void removeAll(int val) { // worst-case: latter half elements are equal to val
// // remove(10) in nums = {1, 2, 3, 2, 4, ..., 10, 10, 10, 10}
// // O(N) * N = O(N*N)
// // search for all the elements equal to val and remove them.
// while(remove(val) > 0);
// }
void removeAll(double val) { // O(N)
int j = 0;
for(int i=0;i<numElements;i++)
if(nums[i] != val)
nums[j++] = nums[i];
numElements = j;
}
double findMin() {
// return the minimum value among elements in nums;
double minV = nums[0];
for(int i=1;i<numElements;i++)
if( nums[i] < minV )
minV = nums[i];
return minV;
}
void sort() { // There is a bug in this code. Find it.
// sort 'nums' in ascending order. eg) 10, 20 , 30
for(int i=0;i<numElements-1;i++) {
int minIdx = i;
for(int j=i+1;j<numElements;j++)
if( nums[j] < nums[minIdx])
minIdx = j;
// swap between nums[i] and nums[minIdx]
double temp = nums[i];
nums[i] = nums[minIdx];
nums[minIdx] = temp;
}
}
double[] toArray() {
// return a copy of the array only with valid elements
//return nums; // this is not a right to return a copy.
double[] new_nums = new double[numElements];
for(int i=0;i<numElements;i++)
new_nums[i] = nums[i];
return new_nums;
}
public MyArrayForDouble clone(){
// return a copy of this instance/object
MyArrayForDouble nums1 = new MyArrayForDouble(this.toArray());
return nums1;
}
public void clear() {
numElements = 0;
}
// In the above class ‘MyArray’, define a new method ‘getElements(int start, int end)’
// that returns a new array. The new array should have elements
// of ‘nums’ from index ‘start’ to ‘end’ inclusively.
// For example, suppose nums = {10,20,30,40,50}. Then getElements(2,4)
// returns a new array {30,40,50}. Assume that index ‘start’ and ‘end’ are valid
// (you don’t need to check their validity).
public double[] getElements(int start, int end) {
double[] new_nums = new double[end-start+1];
for(int i= start; i <= end ; i++)
new_nums[i-start] = nums[i];
return new_nums;
}
boolean isEmpty() { return numElements == 0; }
boolean isFull() { return numElements==nums.length; }
}

----------------------------------------------------------------------
public class MyArrayDemo {
static void printArray(int[] nums){
for(int i=0; i<nums.length;i++)
System.out.print(nums[i]+" ");
System.out.println();
}
public static void main(String[] args) {
// MyArrayForDouble mynums1 = new MyArrayForDouble();
// mynums1.add(10.5); mynums1.add(1.9); mynums1.add(-0.2); mynums1.add(10.5); mynums1.printArray();
// System.out.println(mynums1.linearSearch(1.9));
// mynums1.remove(1.9); mynums1.printArray();
// mynums1.removeAll(10.5); mynums1.printArray();
// Add your code to test MyArrayForString and MyArrayForChar
// --> Required.
}
}

Create MyArrayForString.java to handle 'String' type elements and
create MyArrayForChar.java to handle 'char' type elements.

Test them in MyArrayDemo.java.

In: Computer Science

#1 We are given the grammar rules A ➝ F B E B ➝ A C...

#1

We are given the grammar rules

A ➝ F B E

B ➝ A C

These rules are only some of the rules of a larger grammar G, but we are not given the remaining rules of G. We are told that A is the start symbol of G and that the following holds:

{ε, c, d} ⊆ FIRST(C)

{ε, e} ⊆ FIRST(E)

{ε, f, g} ⊆ FIRST(F)

Recall that end of file is denoted EOF. The symbol ⊆ is used to denote set inclusion. For example, {ε, c, d} ⊆ FIRST(C) means that ε, c, and d are all elements of FIRST(C). Which of the following must hold?

c ∈ FIRST(B)

EOF ∈ FIRST(B)

a ∈ FIRST(B)

ε ∈ FIRST(B)

f ∈ FIRST(B) -- Correct Answer

d ∈ FIRST(B)

Need explanation on how to get First(A) and First(B).

#2

We are given the grammar rules

A ➝ F E

B ➝ A C

           These rules are only some of the rules of a larger grammar G, but we are not given the remaining rules of G. We are told that A is the start symbol of G and that the following holds:

{ε, c, d} ⊆ FIRST(C)

{ε, e}      ⊆ FIRST(E)

{ε, f, g}   ⊆ FIRST(F)

Recall that end of file is denoted EOF. The symbol ⊆ is used to denote set inclusion. For example, {ε, c, d} ⊆ FIRST(C) means that ε, c, and d are all elements of FIRST(C). Which of the following must hold (more than one choice or no choice can be correct)?

ε ∈ FIRST(B) -- Correct Answer  

EOF ∈ FIRST(B)

f ∈ FIRST(B) --  Correct Answer  

d ∈ FIRST(B) --  Correct Answer  

c ∈ FIRST(B) --  Correct Answer  

I can get {f,g,e} for First(B). Need explanation why empty, d, and c are a part of First(B).

In: Computer Science

6. The cloud means different things to different groups of people. How are these definitions related?...

6. The cloud means different things to different groups of people. How are these definitions related? Which definition do you use?

7. What can cloud-based computing do that a small or medium-size company cannot do for itself? 8. How does a ticket system improve our ability to track WIP?

In: Computer Science

discuss a relevant issue regarding Hardening of Information Systems

discuss a relevant issue regarding Hardening of Information Systems

In: Computer Science

Describe some problems with performing object detection using NCC methods.

Describe some problems with performing object detection using NCC methods.

In: Computer Science

5 – What cmdlet will add content to a file? 7 - How would you use...

5 – What cmdlet will add content to a file?
7 - How would you use the command from question 5 to write the date in a text file?

In: Computer Science

Susan has been tasked with developing a new Information Systems for a small company. Susan however...

Susan has been tasked with developing a new Information Systems for a small company. Susan however decided to skip system planning and system analysis phases altogether and proceed with the development and implementation phases. Briefly explain why Susan’s approach is wrong.

In: Computer Science

Give an english description of an algorithm which can determine whether or not characters can be...

Give an english description of an algorithm which can determine whether or not characters can be arranged into a palindrome when given an input string of X characters. Then, determine order of growth of this algorithm as a function of X. (These characters can only be any of the twenty six lower case alphabet letters.)

In: Computer Science

A server is a computer or device on a network that manages network resources. Servers are...

A server is a computer or device on a network that manages network resources. Servers are often dedicated, meaning that they perform no other tasks besides their server tasks. On multiprocessing operating systems however, a server may be one of several programs that are each managing specific requests for services from clients or a particular hardware or software resource, rather than the entire computer.

For each of the server types below, provide a short description of the service each provides to its clients.

  1. Server Platform
  2. Application Server
  3. Audio/Video Server
  4. Chat Server
  5. Database Server
  6. DNS Server
  7. Exchange Server
  8. Fax Server
  9. File Server
  10. FTP Server
  11. Groupware Server
  12. IRC Server
  13. List Server
  14. Mail Server
  15. Monitoring/management server
  16. News Server
  17. Online Gaming Server
  18. Open Source Server.
  19. Print Server
  20. Proxy Server
  21. Real-Time Communication Server
  22. Telnet Server
  23. Web Servers
  24. Virtual Server

In: Computer Science

Task 4:         Tuples Explain what is the difference between list, string and tuple? Create a list...

Task 4:         Tuples

  1. Explain what is the difference between list, string and tuple?
  2. Create a list example and check whether you could change the item within the list.
  3. Create a string example and check whether you could change the item within the string.
  4. Create a tuple example and check whether you could change the item within the tuple.

In: Computer Science

In a Servlet, how do you read HTML Form Data (data from the previous Web page)...

In a Servlet, how do you read HTML Form Data (data from the previous Web page) into the Servlet?

In: Computer Science

In a double linked chain, each node can point to the previous node as well as...

In a double linked chain, each node can point to the previous node as well as the next node. Illustrate and list the steps necessary to add a node to the end of the doubly linked chain.

In: Computer Science

DFR diagrams could become highly complex. In your own words, where does the complexity of DFD...

DFR diagrams could become highly complex. In your own words, where does the complexity of DFD stem from? Also, provide strategies to minimise the complexity of DFD diagrams?

In: Computer Science