Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

Does anyone know how to write the pseudocode for a program that gets the radius and height of a cylinder from the user, and then calculates the volume of the cylinder by using the following formula: Volume = radius * radius * height * 3.1416 Any help would be very much appreciated.

OpenStudy (anonymous):

You have just written the pseudocode yourself!!! Unless you don't know what a pseudocode is!

OpenStudy (anonymous):

Ok. I have had enough of you. You obviously have no clue what you are talking about. I know exactly what pseudocode is. I am asking if anyone knows how to and\or is willing to write out the code in the problem so that I can see what it looks like. The next time you respond to one of my questions with a smart retriceattitude I am going to report you to the moderators of this site Chris2332. Everyone else, I apologize for that. I'm sure that there are decent people on here that are willing to help.

OpenStudy (anonymous):

You really do have all the p-code already. Ask user for height; store in h Ask user for radius; store in r calculate volume v = r * r * h + Pi print v

OpenStudy (anonymous):

@Nyeel I don't really know why you reacted like that. I was very polite and i said that you have already done what you ask for. Was just trying to understand what you needed help with. No problem if you don't need my help anymore, it's fine! Best of luck mate!

OpenStudy (anonymous):

Chris2332 I apologize. You have placed exclamation points in every response you have given me thus far and it seems like you are yelling at me. Your online etiquette could use a little work and I guess I may have taken you the wrong way. Once again I apologize. jon.stromer.galley, thank you very much indeed. That was exactly what I was looking for.

OpenStudy (anonymous):

Guys how would I write out the code for getting the volume of a cylinder to look like the code in this example: Main Module // Declare global variables that are used in more than one module Declare OriginalPrice As Float Declare DiscountPercentage As Float Declare Discount As Float Declare SalesTaxPercentage As Float Declare SalesTax As Float Declare DiscountedPrice As Float Declare TotalPrice As Float // Call submodules Call Get User Input Module Call Calculate Discount Module Call Calculate Discounted Price Module Call Calculate Sales Tax Module Call Calculate Total Price Module Call Display Total Price Module End Program Get User Input Module // Declare a local variable that is only used in this module Declare ItemName As String // Get the name of the item Write “What is the name of the item?” Input ItemName // Get the original price of the item from the user Write “What is the original price?” Input OriginalPrice // Get the discount percentage from the user Write “What is the discount percentage?” Input DiscountPercentage // Get the sales tax percentage from the user Write “What is the sales tax percentage?” Input SalesTaxPercentage Calculate Discount Module // Calculate the amount of the discount Set Discount = OriginalPrice * DiscountPercentage / 100 Calculate Discounted Price Module // Calculate the discounted price Set DiscountedPrice = OriginalPrice - Discount Calculate Sales Tax Module // Calculate the amount of the sales tax Set SalesTax = DiscountedPrice * SalesTaxPercentage / 100 Calculate Total Price Module // Calculate the total price Set TotalPrice = DiscountedPrice + SalesTax Display Total Price Module // Display the result to the user Write “The total price of the item is $” + TotalPrice

OpenStudy (anonymous):

Ohh exclamation mark is my thing... not yelling, it's in every one of my sentences!!! :)

OpenStudy (anonymous):

Well then I am very sorry for jumping to conclusions. I apologize if I have offended you by my earlier post sir. Well then, now that we can be friends again, I have another programming question. If you would, could you tell me what is the difference between a sequential control structure and a selection control structure? Also, could you explain how both control structures could be used in the algorithm for the simple task of making a peanut butter sandwich and how the code would look please?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!