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, 21.06.2019 22:00
Which is produced by the endocrine system to control how cells and organs function
Answers: 2
question
Computers and Technology, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
Animations and transitions are added from the
Answers: 1
question
Computers and Technology, 24.06.2019 10:10
Scanning the road can be thought of as a
Answers: 2
You know the right answer?
Please using c language code provided:
#include
int main(void) {
double totalWet...
Questions
question
Mathematics, 01.08.2019 17:30
Questions on the website: 13722367