Answer to Question #250609 in C++ for IForgotI

Question #250609

Hello!

I am trying to find how many jelly beans can fit in a jar. so I made some variables.


 double height, diameter, beanLength, beanDiameter, glassThickness, radius, newRadius;

  double volumeOfJar, airCubicInches, trueVolume, jellyBeanVolume;


as show here. But I need to initialize them. so I tried this


 int height;

  int diameter;

  int beanLength; beanLength = 0.625;

  int beanDiameter; beanDiameter = 0.25;

  int glassThickness;

  int radius;

  int newRadius;

  int volumeOfJar;

  int airCubicInches;

  int trueVolume;

  int jellyBeanVolume;


But my program does not like that. How do I fix the varibles to be initialized?



1
Expert's answer
2021-10-13T03:50:48-0400
Declare all the variables to be double as stated in the question.
double height;
double diameter;
double beanLength; beanLength = 0.625;
double beanDiameter; beanDiameter = 0.25;
double glassThickness;
double  radius;
double newRadius;
double volumeOfJar;
double airCubicInches;
double  trueVolume;
double jellyBeanVolume;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS