Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Best tutor, I am trying to work through a c programming course. The topic is pointers and arrays. The picture belows shows the problem i
Best tutor,
I am trying to work through a c programming course. The topic is pointers and arrays. The picture belows shows the problem i have trouble with. I don't really know how to input is structured. I dont know what is what. If you could explain the structure of the input and how you could calculate (i dont want the code) the output, it would be great. In a table below i will include extra input and output data.
Extra input 1
5 5 7.50 10 3 5 3 10 20 10 15 0 40 15 8 10 1 60 80 2 5 10
Extra out put 1
345.00 427.50 985.00
Extra input 2
100 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100
Extra output 2
2000.00 20000.00Assignment 4.3: Calculate expenses Suppose a company wants a flexible program which can calculate how much money every customer spends. The company sells n products and has m customers. Write a program that has the product prices and the amount of products every customer buys as input. The output is the amount of money spent by each customer. The values n and m can vary and will be specified at the input. However, both n and wll never be larger than 100 input: The values of n, followed by the price of the n products. Next, the value of m, followed (per line) by the amount of these n products every customer has bought. Note that scanf does not distinguish between spaces and newlines. 5 7.50 10 3 10 20 10 15 40 15 8 10 output: The amount of money that every customer has spent, accurate to two digits after the decimal point. 345.00 422.50 The output must only be printed after all inputs have been read
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started