Input two arrays of information

Assignment Help Basic Computer Science
Reference no: EM131268730

Write a program that will input two arrays of information. Each array will contain exactly 4floating point values. Your program will enter these values from standard input. Once the values have been read in, your program should call a function that will compute the inner product of these two arrays. The function should return the value back to the main program. The main program will then print out the value. You should not print the value out inside the inner product function. The inner product of two arrays is a single number obtained by multiplying corresponding elements and then adding up their sums.

E.g., if array u = (5, 1, 6, 2) and array v = (1, 2, 3, 4) then the inner product is 33

because (5 * 1) = 5 (1 * 2) = 2 (6 * 3) = 18 (2 * 4) = 8

and 5 + 2 + 18 + 8 is 33.

Your main function will call a function called inner that has the following declaration:

float inner ( float u[], float v[], int size ) ;

Do not hardcode the loop inside inner to go from 0 to 3.

It should go from 0 to size-1.

Reference no: EM131268730

Questions Cloud

What effects has oprah''s charisma had on her followers : What effects has Oprah's charisma had on her followers?
Write a single statement that assigns the values : Write a single statement that assigns the values 99, 100 and 88 to an integer array named TestScores. Use the C++ notation used for the "lotterynumbers" array.
Nested loops to generate a triangle : Write a program called program41.py that uses a for loop and the range functionto output the numbers from 5 up to 100 - Write another program called program42.py that generates exactly the same output
Method that returns the number of consonants : Write a class with a constructor that accepts a String object as its argument. The class should have a method that returns the number of vowels in the string, and another method that returns the number of consonants in the string. Demonstrate the ..
Input two arrays of information : Write a program that will input two arrays of information. Each array will contain exactly 4floating point values. Your program will enter these values from standard input.
Malloc up space for a one-dimensional array of n integers : Write a program that will first read in a positive integer number, say n, from standard input. Then you need to create enough space in the heap via a call to malloc to hold an array of n integers.You then need to use array index operators to fill ..
How fast is its daily cost for hamburgers increasing : If the restaurant s daily sales are increasing at the rate of 30 hamburgers per day, how fast is its daily cost for hamburgers increasing?
Determine the average of some integers : Write a program named program43.py that uses nested loops to generate a triangle as shown in the sample run. The program should begin by prompting the user to enter the number of lines in the triangle.
How fast is its daily cost for hamburgers increasing : If the restaurant s daily sales are increasing at the rate of 30 hamburgers per day, how fast is its daily cost for hamburgers increasing?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What value is the log function sensitive

If x~y(both have values close to each other but not same), then we would expect some cancellation in computing log(x)-log(y). on the other hand, log(x)-log(y)=log(x/y), and the latter involves no cancellation. Does this mean that computing log..

  Find the probability that a customer is served x times

Find the equilibrium probabilities for the number in the system.

  What is wrong with how gold coast advertising measures

1. What is wrong with how Gold Coast Advertising measures its quality? Explain why Gold Coast should ask its customers about how they define quality.

  Explain cost and scope in procurement management section

Please review the attached paper and make necessary corrections. Additionally please include triple threat items - time, cost and scope in Procurement Management section in following sections

  Application-information security laws

You probably obey most laws; however, you may not view some seriously enough to obey them. For example, you might be someone who is comfortable going faster than the posted speed limit.

  Plate and on the circular edge

The temperature on a circular plate, (x-1)^2+y^2=4,has formula, T (x,y)= x^2+y^2+60. Find all hot/cold spots, alongwith temperatures, both (a) within the plate and (b) on the circular edge.

  Is this technique taylorian in nature

As a system analyst to do requirement elicitation of UNB course registration system, use an example to tell how you can apply this technique to your elicitation task.

  Ethical misconduct in the business world

Is the Sarbannes-Oxeley which resulted from the Enron Scandal (and other corporate scandals) fulling addressing addressing the issues of ethical misconduct in the business world? What could (potentially) be done to curb these issues in our society..

  Circumcentre of of the triangle

1. Let ABC be a right-angled triangle with ∠B = 90?. Let BD be thealtitude from B on to AC. Let P, Q and I be the incentres of triangles ABD, CBD and ABC respectively. Show that the circumcentre of of the triangle P IQ lies on the hypotenuse AC.

  Similarities and differences of the purchasing strategy

Write a 700- to 1050-word paper that defines the similarities and differences of the purchasing strategy you will use at each stage of the Product Life Cycle of your company's specific product.

  The current environment

The current environment doesn't have wireless interface, and the management would like to procure a cutting edge wireless technology infrastructure for the organisation.

  Find out what happens if you leave the host name out

Most Telnet clients can be used to connect to port 25, the SMTP port, instead of to the Telnet port. Using such a tool, connect to an SMTP server and send yourself (or someone else, with permission) some forged email. Then examine the headers for ..

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