Instructions A size of a jumbo candy bar with rectangular shape is l x w x h . Due to rising costs of cocoa, the volume of the candy bar is to be reduced by p% . To accomplish this, the management...

1 answer below »

Instructions



A size of a jumbo candy bar with rectangular shape isl x w x h. Due to rising costs of cocoa, the volume of the candy bar is to be reduced byp%.


To accomplish this, the management decided to keep the height of the candy bar the same, and reduce the length and width by the same amount.


For example, ifl=12,w=7,h=3, andp=10, then the new dimension of the candy bar is11.39x6.64x3.


Below is an example of how the completed program should work:



Enter the length, width, and height of the candy bar separated by space(s): 12 7 3 Enter the amount of the reduced volume as a percentage: 10 The new dimensions of the candy bar is: 11.38 x 6.64 x 3.00


Format your output withsetprecision(2)to ensure the proper number of decimals for testing!






Instructions A size of a jumbo candy bar with rectangular shape is l x w x h. Due to rising costs of cocoa, the volume of the candy bar is to be reduced by p%. To accomplish this, the management decided to keep the height of the candy bar the same, and reduce the length and width by the same amount. For example, if l = 12, w = 7, h = 3, and p = 10, then the new dimension of the candy bar is 11.39 x 6.64 x 3. Below is an example of how the completed program should work: Enter the length, width, and height of the candy bar separated by space(s): 12 7 3 Enter the amount of the reduced volume as a percentage: 10 The new dimensions of the candy bar is: 11.38 x 6.64 x 3.00 Format your output with setprecision(2) to ensure the proper number of decimals for testing! Test run shows what was expected and what failed: Tasks 0.00 out of 10.00 Correct dimensions output 2 0 out of 2 checks passed. Review the results below for more details. Checks Test CaseIncomplete Correct dimensions output test 1 Input 12 7 3 10 Output Results 11.3 x 6.6 x 3 Show Details Test CaseIncomplete Correct dimensions output test 2 Input 14 8 2 8 Output Results 13.4 x 7.6 x 2
Answered 2 days AfterOct 02, 2021

Answer To: Instructions A size of a jumbo candy bar with rectangular shape is l x w x h . Due to rising costs...

Neha answered on Oct 02 2021
147 Votes
#include
#include
#include
using namespace std;
int main(){
doub
le l, w, h, p, vol, new_vol;
cout<<"Enter length, width, height: ";
cin>>l>>w>>h;
cout<<"Enter volume percent: ";
cin>>p;
/*
l1 * w1 * h = new_vol
(l-x)*(w-x) = new_vol/h [Let new_vol/h = a]
(l-x)*(w-x) = a
x^2 - (l+w)*x + l*w = a
This is a...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here