#Vase Calculations

1 messages · Page 1 of 1 (latest)

silver thistle
#

So for my into to computer science class I need to write a program that asks the user the radius, the height, and how many vases to make, and calculates how much material is needed for the bottom and how much material is needed for side for the number of vases requested. The formula for diameter of the circle is 2 x radius, the perimeter of the circle is 2 x ∏ x radius (use 3.14159 for ∏). This is all in C++. Can you please help me?

#

<@&1170904818810880060>

meager copper
#

have you done the previous steps? drawing the vase and pseudocode?

#

with what exacty do you need help?

silver thistle
#

I have drawn the vase but haven't done the pseudocode. I need help with figuring out what variables I need to put down

primal surge
#

it doesn't really help people when you just give them the code to run.

shut forum
#

Oh

#

My apologies

primal surge
#

Everyone needs to learn how to debug their code, write code, and plan it out. Intro to coding classes establish those skills and practices before getting to really complex problems/projects

shut forum
#

agreed

primal surge
#

@silver thistle i would start with writing out the pseudocode and give it your best shot.

primal surge
#

We can help you with your pseudocode afterwards

silver thistle
#

here it so far, idk what to do

primal surge
#

I am on mobile so I wont be able to view

#

I dont think i need the whole zip folder, do you have just your pseudocode

primal surge
#

It looks like a reiteration of your problem/assignment.

Start with pseudocode. If you're unsure what pseudocode is, its fake code, in otherwords english descriptions step by step that plans out the structure of code. something that looks like this:

Ex. A vending machine program 
START: 
Options = chips, protein bar, candy, soda. 
Prices = 1.20$, 1.40$, 0.50$, 1.00$ 
Ask user for their option 
if their option is chips: 
     Total is 1.20$
if their option is protein bar: 
     total is 1.40$ 
if their option is candy: 
     total is 0.50$
if their option is soda: 
    total is 1.00$

Ask user for money 
If money > total : 
     change is money - total

give user change
END
#

Where are you stuck? Do you understand your problem?

silver thistle
#

No I don't understand the problem

primal surge
#

Okay first you should do the user input. What are you asking the user?

#

List your input

silver thistle
#

the radius, the height and how many vases to make

primal surge
#

Okay start with psuedo code for that

#

Then, what is your output

silver thistle
#

the output is the total for the bottom and the total for the sides

#

is that right?

primal surge
#

Yes that is what it seems from my perspective

silver thistle
#

So here is my input and output I made

#

Input:
Asks the user the radius of the vase
Asks the user the height of the vase
Asks the user how many vases to make

Output:
Prints out the length and width of the material needed to make the bottom
Prints out the length and width of the material needed to make the side

primal surge
#

Awesome next step is lets say you have those values how would you calculate the bottom

#

How much surface area does the bottom have

silver thistle
#

would it be Pi * radius^2?

primal surge
#

I believe so

silver thistle
#

ok

primal surge
#

Someone can correct me if I am wrong

#

I do think that is to calculate the bottom surface area of a circular vase

silver thistle
#

ok

#

and I think the side would be 2 * Pi * radius

primal surge
#

Yep

#

Thats what i am thinking too!

#

Now what does your pseudocode look like

silver thistle
#

hold on let me type it out

#

Here's the typed out version if you can't see it:

#

Problem:
A manufacturing company makes metalic vases of any radius and any height. They have a bottom, but not a top. If they want to make one vase, they purchase a square of material for the bottom and laser-cut the circle from that, and another piece of material for the side, which is machine rolled to form the side.

Formula:
Diameter of circle: 2x radius
Perimeter of circle: 2x x radius

Input:
Asks the user the radius of the vase
Asks the user the height of the vase
Asks the user how many vases to make

Output:
Prints out the length and width of the material needed to make the bottom
Prints out the length and width of the material needed to make the side

Calculations:
bottomArea= Pi * radius^2
sideArea = 2 * Pi * radius

#

is it right?

primal surge
#

Side area is not quite there I think because it only gives you the circumference. It doesn't look like you use height

silver thistle
#

oh

primal surge
#

You need to calculate the area

#

If it is a cylinder then you'd use the formula for it

#

But i think that would be a question for your teacher

silver thistle
#

I think it's a cylinder

primal surge
#

Then you need the formula for it

#

You need to write the pseudo code like

START 
INPUT
CALC
OUTPUT
END
silver thistle
#

ok

primal surge
#

Then translate each step into code

silver thistle
#

ok

#

I think I get it now

#

ty!

primal surge