First integer of input refers to the total weight the ship

Assignment Help Basic Computer Science
Reference no: EM13166980

First integer of input refers to the total weight the ship can carry. Second integer refers to the number of cargo present and the rest of the integers represents the individual weight of the cargo

For output, all integers except the last are the individual weight of the cargo in order of their previous input and the final integer represents the total weight

 

Input 99 7 50 40 2 3 8 13 24
Output 50 40 8 98

Input 62 7 50 40 2 3 8 13 24
Output 50 3 8 61
Input 23 6 8 12 13 5 6 4
Output 8 5 6 4 23

 

 

Reference no: EM13166980

Questions Cloud

Write a java program that reads unspecified number : Write a java program that reads unspecified number of integers (the input 0 signifies the end of the input). Calculates and displays the sum and the average of the input value (not counting zero). The program also finds the maximum and minimum of ..
Write an arm assembly function that takes an array of intege : Write an ARM assembly function that takes an array of integers and returns the index of the first occurrence of the integer in the array if it exists or -1 if it does not. Remember the initial integer in the array is at index zero.
The radix sort algorithm : Show what happens to the radix sort algorithm if the counting sort is not a stable sorting algorithm. Bring a counter example
Create a program that will round a floating point : Create a program that will round a floating point value to a specified number of decimal places as input by the user. To perform the actual calculation, write a function that takes the user's value and the number of decimal places as input paramet..
First integer of input refers to the total weight the ship : First integer of input refers to the total weight the ship can carry. Second integer refers to the number of cargo present and the rest of the integers represents the individual weight of the cargo
First integer of input refers to the total weight the ship : First integer of input refers to the total weight the ship can carry. Second integer refers to the number of cargo present and the rest of the integers represents the individual weight of the cargo
Write a matlab function newtonraphson : Write a MATLAB function newtonRaphson(fx, x0, sigfig, maxIT) that will return a root of the function f(x) near x=x0 using the Newton-Raphson method, where sigfig is the accuracy of the solution in terms of significant figures
Write a curried function to add n : Write a curried function to add N (where N is an integer) to each item of a list.
Cache access time of 20ns : Given a cache access time of 20ns, a main memory access time of 1000ns, and a cache hit ratio of 90 percent. Assuming fetches to main memory are started in parallel with look-ups in cache

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explain computer software required to make computers work

Develop 5- to 7-slide PowerPoint presentation, providing the overview of how computers are used. Distinguish various kinds of computer software required to make computers work.

  How long will it take to reach steady-state value

Investigate the effect of the parameter b on y(t). To do this, plot y versus t for several values of b on the same plot. How long will it take for y(t) to reach 98 percent of its steady-state value?

  Create directories in home directory begin-mac-mac directory

Create following directories in your home directory cp_even, cp_mid,cp_iso,cp,thousand,cp_even. Examine files in the /usr/share/tcl8.3/encoding directory copy all files which begin with mac into mac directory.

  Describe method to execute account harvesting

Describe the threat of account harvesting. Suggest a method to execute an account harvesting attack on a Windows platform.

  Prompts the user for the prices of 10 automobiles

Write a program that prompts the user for the prices of 10 automobiles (use looping to do this and store the prices in an array). The automobiles may be priced from less than $1 up to $99,999. No negative numbers are allowed. Perform error checkin..

  Collecting information for data dictionary

Pproblems generated by going directly to manager with questions regarding data dictionary entries? Describe to the team member how he can better collect information for the data dictionary.

  Public boolean chackanagram

write the anagramList() chackanagram. checkAnagram returns true if its two Word parameters have original words that are nagrams. If not, checkAnagram returns false. use the ethod header below to write checkanagram. Assume that all Word methods work a..

  The lisp function length counts

The Lisp function LENGTH counts the number of elements in the top level of a list. Write a function ALL-LENGTH of one argument that counts the number of atoms that occur in a list at all levels.  Thus, the following lists will have the following A..

  Let''s try to make inheritance

Let's try to make inheritance a little less abstract and a little bit more concrete. In order to do this, we will model a simple inheritance relationship

  Estimate benefit of a revenue-generating system

Is management able to estimate the benefit of a revenue-generating system or must the system be built on faith? Why?

  Trojan horse defense

Using your favorite search engine, look up "Trojan Horse Defense". How can it be used to question the conclusions drawn from a forensic investigation? Site a case where it was used.

  What is the speedup of the system with l2 cache?

computer calculate the following: (a) What is the L2 read miss penalty? (b) What is the L1 read miss penalty? (c) What is the read penalty (L1 and L2 cache)? (d) Assume 33% (1/3) loads, and everything else is ideal. What is the CPI? (e) What would th..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd