subject

Please using c language code provided:
#include
int main(void) {
double totalWet, totalDry, ratio;
double wet[2];
double dry[3];
double * cookie[2] = {wet, dry};
scanf("%lf%lf", &wet[0], &wet[1]);
scanf("%lf%lf%lf", &dry[0], &dry[1], &dry[2]);
// Add one line here!
/* The line you add should use the array cookie (and not the array wet) to
find the sum of the wet ingredients of the cookie recipe and store that sum
in the variable totalWet. Use only indexed notation to address the cookie
array (that is, you need to use two pairs of brackets [..]).
*/
printf("Total amount of wet ingredients: %.2lf grams.\n", totalWet);
// Add one line here!
/* The line you add should use the array cookie (and not the array dry) to
find the sum of the dry ingredients of the cookie recipe and store that sum
in the variable totalDry. This time, use only one pair of brackets [..] each
time you address the cookie array.
*/
printf("Total amount of dry ingredients: %.2lf grams.\n", totalDry);
ratio = totalDry/totalWet;
printf("Ratio of wet to dry ingredients: %.2lf.\n", ratio);
// Add two lines here.
/* The lines you add should use the array cookie (and not the array wet) to
update the amounts of water and oil in your recipe.
You believe that any cookie recipe should use equal amounts of water and oil.
Without changing the total amount of wet ingredients, update the values for
water and oil, using only the array cookie (and not the array wet) so that
these amounts will be equal. The easiest way to do so is to assign the value
totalWet/2 to both the water and the oil entry. When addressing the array cookie,
do not use any brackets at all this time.
*/
printf("New water amount: %.2lf grams, new oil amount: %.2lf grams.\n", wet[0], wet[1]);
return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 23.06.2019 20:30
What are some settings you can control when formatting columns?
Answers: 1
You know the right answer?
Please using c language code provided:
#include
int main(void) {
double totalWet...
Questions
question
Chemistry, 17.06.2020 20:57
Questions on the website: 13722367