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

  Five areas of negligence for allied health professionals

Mention five areas of negligence for allied health professionals. Discuss the standard of care in each area, and how that standard can be applied to the health care facility.

  Structure of the house of representatives with senate

compare and contrast the structure of the house of representatives with that of the senate. (size, term, requirements, etc.)

  The concepts of absolute and relative power contrast

The concepts of absolute and relative power contrast?

  Traditional approach to group problem solving

Identify and explain each of the five steps in the traditional approach to group problem solving. Many social scientists now include %u201Cestablishing criteria%u201D as a separate step. Add this to your list of steps in the process and explain.

  Memory is the minds storehouse

Describe how episodic and implicit memories can foster learning which contributes to survival.

  Climate of eastern washington and eastern oregon

Climate of eastern Washington and eastern Oregon are much drier than that of the western parts of the states. How does the geographic factor of topography explain this pattern?

  Police personality-psychological-educational theories

position paper on the concept of “police personality” focusing on the four main theories or explanations: Psychological theories, Educational theories, Sociological theories, Organizational theories

  Analyze issues related to punishment and prevention

Analyze issues related to punishment and prevention. Then, comment on the following statement: If it can be shown that punishment fails to prevent crime, then, by utilitarian standards, we have no grounds on which to punish.

  Cruise line operating truly luxurious ships

You are marketing director for a cruise line operating truly luxurious ships. These have superb service and cuisine. How would you proceed to identify the most promising distributors?

  Cognitive-gestalt-evolutionary psychology perspectives

Give a short Comparison and Contrast of these 3 Psychological perspectives:

  Analyze the mail rental and video-on-demand

Use Porter’s Five Forces Model to analyze the mail rental and video-on-demand industries in the U.S. Given this analysis, are these industries attractive or not?

  Process of the trade financing with a letter of credit

Discuss the process of the trade financing with a letter of credit? From an international perspective, what are the two main types of negotiations? What are the disadvantages and advantages for each?

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