Which Myers-Briggs Personality Types Are Compatible?
Q&A for How to Write Pseudocode
Coming soon
Search
-
QuestionIs programming always required?Community AnswerPseudocode isn't real code, but details what a program should do step by step. Knowing how to write code is necessary to writing meaningful and useful pseudocode.
-
QuestionHow can I tell the difference between an odd and even number using pseudocode?Community AnswerDivide it by two to see if you get a remainder. If not, then it's even; if yes, then it's odd.
-
QuestionHow do I spot errors in pseudocode?ScratchlessCommunity AnswerSince pseudocode isn't real code, there can't be any errors. You decide what you want to write as pseudocode and then translate it to any coding language you'd like.
-
QuestionWhere can I write pseudocode?Community AnswerWhen you start jotting it down it can be anything from a notepad to a napkin or a dedicated writing application like Word or Google Docs. Once you start detailing your pseudocode I recommend switching over to a plain text/raw text (.txt) application such as Notepad, TextEdit, WordPad, and then begin translating it to actual code gradually. It's very important to remember that a computer CANNOT execute code written in a formatted document file, such as .doc or .docx, pdf. They can only interpret .txt plain text, made into something like a .jar, .class, etc (developer file formats). You cannot run code with just raw text. Remember to make it a dev file first.
-
QuestionIs pseudocode necessary for programming?Community AnswerIt isn't exactly necessary, but knowing pseudocode helps in learning how to program faster.
-
QuestionHow do I write pseudocode?Community AnswerFollow the steps here to learn!
-
QuestionCan I use words such as "count" to sum up data in writing a pseudocode?Community AnswerYou can do whatever you like in pseudocode! Just as long as you know how to convert it to actual code, anything goes.
-
QuestionIs verbal the right word?Community AnswerVerbal works in this context: as in "relating to or in the form of words." In your head, as you read the article, try replacing "verbal" with "written out in words."
-
QuestionCan I use dedicated/made-up functions (i.e. PLAYSOUND, MAKE, READ, WRITE, etc.)?ScratchlessCommunity AnswerOf course. You decide what you write in pseudocode. It won't come up with any errors and as long as you know how to code it into a programming language you should be fine.
-
QuestionHow do I use the if condition when I have many cases?Random LettersCommunity AnswerYou can use 'else if' or a 'switch' statement. Since pseudocode is informal, you have flexibility in your approach.
-
QuestionHow do I write pseudocode to check if one variable is equal to another?AppleParkWayCommunity AnswerTo check if one variable is equal to another in pseudocode, use an 'if' statement. For example: "IF var1 = var2 THEN print 'Equal' ELSE print 'Not Equal'."
-
QuestionHow do I declare variables in pseudocode?Random LettersCommunity AnswerYou can declare variables in pseudocode using: "variable name := value" or "SET variable name TO value."
-
QuestionWhat is the difference between SET and GET, and which one comes first?Random LettersCommunity AnswerIn pseudocode, it doesn't matter which you use first. SET usually creates or sets a variable, while GET retrieves its value.
-
QuestionCan I use Microsoft Word to write pseudocode?AppleParkWayCommunity AnswerYes, you can use Microsoft Word to write pseudocode since it doesn't require a compiler or interpreter. Pseudocode can be written on any word processor or even on paper.
-
QuestionHow do I write pseudocode to calculate the sum of the squares of a given input of numbers?AppleParkWayCommunity AnswerTo calculate the sum of squares in pseudocode, first define a list to hold your numbers. Then, iterate over each number, square it, and add it to a running total. Finally, output the total. Here's a basic example: Initialize total = 0; For each number in input, set total = total + (number^2); Output total. Adjust the syntax as needed for your specific use case.
-
QuestionHow do I write pseudocode to calculate the gross pay for five employees, given their names, levels, and hours worked?Joseph - underlabsCommunity AnswerSet num_employees = 5. For i = 1 to num_employees: Input employee_name, employee_level, hours_worked. If employee_level < 40: gross_pay = hours_worked * pay_rate. Else: overtime_hours = hours_worked - 40, overtime_pay = overtime_hours * pay_rate * 1.5. Gross_pay = hours_worked * pay_rate + overtime_pay. Print employee_name, gross_pay. This calculates regular and overtime pay, capping hours at 40, and prints gross pay for each employee.
-
QuestionHow do I write a program to convert a person's height from inches to centimeters and their weight from stones to kilograms?Mada SluckCommunity AnswerMultiply the height in inches by 2.54 and the weight in stones by 6.364 to convert them to centimeters and kilograms, respectively.
-
QuestionWrite a Pseudocode that will accepts two integers and calculate the sum, product and average of the two inputted integers. Display the results.Simeon WatsonCommunity AnswerThat would be written as: integer1 = integer(input(Integer 1: )) integer2 = integer(input(Integer 2: )) sum = integer1 + integer 2 product = integer1 * integer2 average = (integer1 + integer2)/2 write { Sum = [sum] Product = [product] Average = [average] }
-
QuestionHow do I write a pseudo code for an algorithm that reads grocery lists and prints out the products needed in alphabetical order?Simeon WatsonCommunity AnswerYou would do that as follows: Access camera. Write "point camera to grocery list" if camera registered type = "text": list = camera read top-to-bottom list sort alphabetically write list
-
QuestionWrite a pseudocode to input the temperature in Fahrenheit and convert it into Celsius?Simeon WatsonCommunity Answerfahrenheit = input "Temperature in degrees Fahrenheit: " write {fahrenheit} degrees Fahrenheit equals {(fahrenheit-32)/1.8} degrees Celsius.
-
QuestionWhat are global variables?Community AnswerVariables that can be used throughout the entire program. A local variable can only be used in the part that created the local variable.
-
QuestionHow to pseudocode for functions? Do we simply write 'call for function()'?Community AnswerA function in real code is like "when FUNCTION_NAME is runned, do:". You can use "when FUNCTION_NAME is runned, do:" for a function Pseudocode start.
-
QuestionIs pseudocode and algorithm the same, or different?Graham TrottCommunity AnswerDifferent. An algorithm is a set of steps to perform a given function; pseudocode is just one way of describing those steps. The steps can be expressed in a conventional programming language or in pseudocode. The former will actually run; the latter will not until translated into computer code. Unless, that is, someone writes a compiler to handle your pseudocode. That's not as silly as it may sound; languages like Apple's HyperTalk closely resemble pseudocode.
-
QuestionHow do I write pseudocode for a switch case structure?Community AnswerBecause switch statements are essentially nested if-else statements, you can use if statements. For example, you could use if for each case and else for the default.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit