Computers and Technology

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;
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 00:30, lovemusic4
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
image
Computers and Technology, 24.06.2019 12:50, vianca15
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, youcandoit13
In simple terms, how would you define a protocol?
Answers: 2
image
Computers and Technology, 24.06.2019 16:30, Dajuan2x
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject after the midsemester exams and the end-of-semester exams. she divides the midsemester and end-of-semester information into two separate worksheets, sheet 1 and sheet 2. how will she rename the two worksheets?
Answers: 2
Do you know the correct answer?
Please using c language code provided:
#include
int main(void) {
double totalWet...

Questions in other subjects: