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

  Draw the histogram

Use your Histogram to answer the following questions: A) Are there more children age 1, or elders age 71? B) Are there more 21yearolds, or 61yearolds? C) Are there more people age 0

  Continental and analytical philosophy

In brief explain the methods and ideas of continental philosophy. Use one of the thinkers in this tradition as your example. In brief explain the methods and ideas of analytical philosophy. Use one of the thinkers in this tradition as your example.

  The abolitionist william lloyd garrison

The abolitionist William Lloyd Garrison

  Development of traditional and modern ethics

The solution provides a discussion on the historical development of both modern and traditional ethics and in process relates the development of both ethical branches to each other.

  Explain significance of development in field

Write down the description of the current topic or development in field and explanation of its significance to those outside of fieldAudience.

  Obedience in everyday life

Obedience in everyday life:based on Milgrams findings,what reason do you think the nurses described in the lecture gave for obeying the doctors orders?

  Diversity efforts focus on ethics

Is it ethical to hire a person with a lower test score because he or she seems to be a better personality fit for an organization?

  Health care costs and quality of care

Hospital emergency departments continue to be used as a source of primary medical care by large numbers of the community’s medically underserved population. What are the implications of this practice for the patients, and on health care costs and qua..

  Text-values and attitudes expressed in ming fiction

According to the text, values and attitudes expressed in Ming fiction and plays began to have an impact on the culture of the literati. How?

  Renaissance music

Which of the following is NOT a characteristic of Renaissance music:

  The earned income tax credit is considered

The Earned Income Tax Credit is considered by policy analysts to be:

  Emotional climate at work in relation to worker productivity

Give a brief (1-3 sentences) description of your area of interest, then explain how conducting research in this area can contribute to you being a scholar-practitioner who effects social change. To conclude your post, explain how you see research, in..

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