Create two single dimension arrays

Assignment Help Other Subject
Reference no: EM13283168

Create two single dimension arrays that contain 10 floating-point numbers in each array. Create a third single dimension array to hold a sum. Your main program will take the two arrays of float and pass them to the function addfloat() Inside the function, add the first array to the second array and put the total into the third array. Print the values of all three arrays back in the main program. Here is what I have so far. I am baffled.

include <stdio.h>

void addfloat(float a[], float b[], float c[]);

    int d = 0;

    for (d = 0; d < 10; d++)

    {

        c[d]=a[d]+b[d]

    }

 

int main()

{

 

    float RCT1[10] = {3.22, 9.99, 23.45, 1.50, 2.63, 11.50, 13.49, 100.88, 8.00, 33.19};

    float RCT2[10] = {9.99, 8.33, 29.99, 14.07, 27.39, 12.28, 1.79, 47.99, 10.00, 13.99};

    float TOT[10];

    int a;

    addfloat(RCT1, RCT2, TOT);

    printf("\nReceipt 1 total: \n");

    for (a = 0; a < 10; a++)

    {

        printf("%2.2f", RCT1);

    }

    printf("\nReceipt 2 total: \n");

    for (a = 0; a < 10; a++)

    {

        printf("%2.2f", RCT2);

    }

    printf("\nTotal of receipts combined; \n");

    for (a = 0; a < 10; a++)

    {

        printf("%2.2f", TOT);

    }

 

    return 0;

 

}

Reference no: EM13283168

Questions Cloud

Importance of teachers probing for learner understanding : Explanation of the importance of teachers probing for learner understanding in order to provide effective learner feedback. ( The teacher giving feedback to the students)
Job descriptions based on the results of a job analysis : Students will apply learned content by creating job families (hierarchies) and two job descriptions based on the results of a job analysis. For more details about the case and your assignment, read the Stars Hollow Hat Company Case (DOC).
Type of market analysis is more macroeconomic in focus : Which type of market analysis is more "macroeconomic" in focus and concentrates on general market conditionssuch as pricing, demographics, and supply and demand?
What are legal issues raised by hydraulic fracturing : What are the legal issues raised by hydraulic fracturing? The environmental issues? What part does (will) hydraulic fracturing play in meeting U.S. energy needs?
Create two single dimension arrays : Create two single dimension arrays that contain 10 floating-point numbers in each array. Create a third single dimension array to hold a sum. Your main program will take the two arrays of float and pass them to the function addfloat() Inside the func..
Pick a product that beneficial for line extension : Pick a product that you believe would be beneficial for line extension. Justify your choice and discuss the strategy you would adopt for the new product
Budgeted sales commissions would appear : Budgeted sales commissions would appear on the?
Dantzig-wolfe decomposition algorithm to solve the problem : Use Dantzig-Wolfe decomposition algorithm to solve the problem
Idea of the hero in greek and roman culture : According to Professor Ambrosio, how does the idea of the hero in Greek and Roman culture become integrated into the idea of the saint in the process of conversion and totalization? Address this question by comparing and contrasting at least two of t..

Reviews

Write a Review

Other Subject Questions & Answers

  Example of a cognitive simplification strategy

Which of the following is an example of a cognitive simplification strategy?

  Traditional cognitive intelligence and emotional intelligenc

What are the differences between traditional cognitive intelligence and emotional intelligence? Provide an example.

  European pharmaceuticals-distribution group alliance

European pharmaceuticals-distribution group Alliance Unichem has used 360-degree feedback to drive change and employee development and increase overall performance.

  Philospher john locke believed

The philospher john locke believed that people? sensation has no effect on perception. the perceived whole differs from the sum of its parts.

  Internal building security

Internal Building Security issues

  Design and environmental analysis class

All cold sources reflect 80% blue light: Artificial lamps all produce yellow/orange light: T/F. Different spectral compositions can change the colors of objects: T/F

  What are weapons of mass destruction

What are weapons of mass destruction? How is the United States working to mitigate the threat? Are International Weapons Inspections an effective tool? Explain in 250 - 300 words. Just a simple write up.

  Developing its information systems

How did Pine Valley Furniture go about developing its information systems? Why do you think the company chose this option? What other options were available?

  Tax rates relative to tax revenue

Explain Arthur Laffer’s theory of tax rates relative to tax revenue. What is the effect of a tax on the deadweight loss? Why it is sometimes difficult to predict what will happen when a tax rate is decreased or increased?

  Sociological viewpoint for possibilities of future career

How might this have influenced schools you attended, health care your received, and possibilities for your future career? Would people view you differently; treat you differently?

  Discuss both the benefits and dangers of police work

Discuss both the benefits and dangers of police work. How does popular culture affect the public's view of police work? Compare and contrast the views of the public towards police officers historically and today. How have your own experiences shaped ..

  The amount of anger-frustration felt

Your dependent variable would be the degree of response in your test subject - the amount of anger/frustration felt. The independent variable would be the type and/or number of points in the instructions that were made to be "inadequate

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