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 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 23.06.2019 01:40
You have a linux system that has a 1000gb hard disk drive, which has a 90gb partition containing an ext4 filesystem mounted to the / directory and a 4gb swap partition. currently, this linux system is only used by a few users for storing small files; however, the department manager wants to upgrade this system and use it to run a database application that will be used by 100 users. the database application and the associated data will take up over 200gb of hard disk space. in addition, these 100 users will store their personal files on the hard disk of the system. each user must have a maximum of 5gb of storage space. the department manager has made it very clear that this system must not exhibit any downtime as a result of hard disk errors. how much hard disk space will you require, and what partitions would you need to ensure that the system will perform as needed? where would these partitions be mounted? what quotas would you implement? what commands would you need to run and what entries to /etc/fstab would you need to create? justify your answers.
Answers: 3
question
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
You know the right answer?
Please using c language code provided:
#include
int main(void) {
double totalWet...
Questions
question
Mathematics, 05.06.2021 01:50
question
Mathematics, 05.06.2021 01:50