Computer Science Homework Solutions

Algorithm, using pseudo code

1. Write an algorithm, using pseudo code, “Word Search”: Given a string of letters, identify all substrings that create one of five given words. For example, if the words (arguments) are: structure; such; system; blue; red, then the string jkdistructuredstrusyssystemoon contains the first, third and fifth words, once each. 2 ...continues

Algorithm

For example, find a simple algorithm for solving the following problem and classify it using big-theta notation: Divide a group of people into two disjoint subgroups (of arbitrary size) such that the difference in the total ages of the members of the two subgroups is as large as possible.Now change the problem so that the des ...continues

Ambiguity in a proposed algorithm

Explain the distinction between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm.

3D Images- parallel projection and perspective projections

I need help with parallel projections and perspective projections, this is what I have so far: Vertex List v X Y Z v X Y Z ... and Face List f V1 V2 V3 f V3 V2 V1 .... I have a java application that reads in a vertex list and face list. I also have code to write 2-D lines and ouput that image file. In my cod ...continues

Simple C program

Write a program that computes and prints the area and volume of a sphere given its radius. (write the program in C, not C++ and create a simple program (this is an introductory exercise in the textbook)– I want to compare it to the program I came up with) Use extensive comments so that I can fully understand what your co ...continues

Algorithm

Quest: In English like pseudo-code, or structured English -- just to make sure everyone can read it; write an algorithm to determine if a string is a palindrome. A palindrome is a word or phrase that is spelled the same whether you are reading it forwards or backwards (ex. race car, Madam I’m Adam). Your algorithm should igno ...continues

Does a queue crawl through memory in the direction of its head or its tail? Explain your answer.

Does a queue crawl through memory in the direction of its head or its tail? Explain your answer.

How to write a Pseudocode algorithm for a simple task such as making turkey sandwich

Create a pseudocode algorithm you would write for a simple task like making a turkey sandwich, as well as three simple control structures that could be used to create this algorithm. What do you think is the most difficult part of creating the algorithm? What can you do to make this process easier?

Java programming

1. Modify the Payroll Program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked. 2. Use a constructor to initialize the employee information, and a method within that class to calculate the weekly pay. Once stop is entered as the employee name, the application ...continues

Control Structures

You are an accountant setting up a payroll system for a small firm. Each line of the table in Appendix G indicates an employee’s salary range and corresponding base tax amount and tax percentage. Given a salary amount, the tax is calculated by adding the base tax for that salary range and the product of percentage of excess and ...continues

Browse