Tuesday, October 12, 2021

Pseudocode how to write discount

Pseudocode how to write discount

pseudocode how to write discount

Jan 29,  · Write a pseudocode to show the discount percentage - Web Design & Development - Neowin. All Activity. Home. Technical Help & item and then calculate and print the new price after a discount of 12% is given. Algorithm solution. 1. START 2. PROMPT USER FOR ITEM PRICE 3. CALCULATE THE DISCOUNT AT 12% 4. CALCULATE THE NEW PRICE 5. PRINT THE NEW PRICE 6. STOP Pseudocode solution BEGIN INPUT PRICE DISCOUNT = PRICE * LET NEW PRICE = PRICE – DISCOUNT PRINT NEWPRICE ENDFile Size: 35KB Sep 27,  · To get the discount percentage for a quantity: public static double discountForQuantity(int quantity) { int i = 0; do { --i; } while (i >= 0 && DISCOUNT_TABLE[i].fromQuantity > quantity); return i



java - How to write a program that solves discount + price - Stack Overflow



Last Updated: May 27, References. This article was written by Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow.


He has over pseudocode how to write discount years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher.


This article has been viewedtimes. This wikiHow teaches you how to create a pseudocode document for your computer program. Pseudocode essentially entails creating a non-programming language outline of your code's intent. Pseudocode serves as an informal guide, a tool for thinking through program problems, and a communication option that can help you explain your ideas to other people.


Clarity is a primary goal of pseudocode, and it may help if you work within accepted programming conventions. As you develop your pseudocode into actual code, you will need to transcribe it into a programming language — so it can help to structure your outline with this in mind. You might even want to get rid of any coding commands altogether and just define each line's process in plain language. For example, "if input is odd, output 'Y'" might become "if user enters an odd number, display 'Y'" instead.


Write the purpose of the process. Write the initial steps that set the stage for functions. Write only one statement per line. Capitalize the initial keyword of each main direction. Write what you mean, not how to program it. Use standard programming structures. Use blocks to structure steps. Add comments if necessary, pseudocode how to write discount.


Did this summary help you? Yes No. Log in Social login does not work in incognito and private browsers. Please log in with your username or email to continue. wikiHow Account. No account yet? Create an account. Community Dashboard Write an Article Request a New Article More Ideas Edit this Article. Courses New Skills for Work New Expert Videos About wikiHow Pro Upgrade Sign In.


Home Random Browse Articles Courses New About wikiHow Easy Ways to Help Approve Questions Fix Spelling Quiz App More Things to Try We use cookies to make wikiHow great. By using our site, you agree to our cookie policy. Cookie Settings.


wikiHow is where trusted research and expert knowledge come together. Learn why people trust wikiHow. Categories Computers and Electronics Software Programming How to Write Pseudocode. Download Article Explore this Article parts.


Tips and Warnings. Related Articles. Article Summary. Written by Jack Lloyd Last Updated: May 27, References, pseudocode how to write discount. Part 1. Know what pseudocode is. Pseudocode is a step-by-step written outline of your code that you can gradually transcribe into the programming language. Many programmers use it to plan out the function of an algorithm before setting themselves to the more technical pseudocode how to write discount of coding. Understand why pseudocode is useful.


Pseudocode is used to show how a computing algorithm should work. Coders often use pseudocode as an intermediate step in programming in between the initial planning stage and the stage of writing actual executable code.


Some other uses of pseudocode include the following: Describing how an algorithm should work. Pseudocode can illustrate where a particular construct, mechanism, or technique could or must appear in a program. Explaining a computing process to less-technical users. Computers need a very strict input syntax to run a program, but humans especially non-programmers may find it easier to understand a more fluid, subjective language that clearly states the purpose of each line of code.


Designing code in a group setting. High-level software architects will often include pseudocode into their designs to help solve a complex problem they see their programmers running into. If you are developing a program along with other coders, you may find that pseudocode helps make your intentions clear.


Remember that pseudocode is subjective and nonstandard. There is no set syntax that you absolutely must use for pseudocode, but it is a common professional courtesy to use standard pseudocode structures that other programmers can easily understand. If you are working with others on a project—whether they are your peers, junior programmers, or non-technical collaborators—it is important to use at least some standard structures so that everyone else can easily understand your intent.


If you are enrolled in a programming course at a university, a coding camp, or a company, you will likely be tested against a taught pseudocode "standard". This standard often varies between institutions and teachers. Focus on the main purpose of pseudocode. It can be easy to revert to writing in code once you hit your stride. Remembering the purpose of your pseudocode—explaining pseudocode how to write discount each line of the program should do—will keep you grounded while creating the pseudocode document.


Part 2, pseudocode how to write discount. Use a plain-text editor. It can be tempting to use a word processor e. Plain-text editors include Notepad Windows and TextEdit Mac. Start by writing down the purpose of the process. Dedicating a line or two to explaining the purpose of your code will help set up the rest of the document, and it will also save you the task of explaining the program's function to each person to whom you show the pseudocode.


Each statement in your pseudocode should express just one action for the computer. In most cases, if the task list is properly drawn, then each task will correspond to one line of pseudocode. Consider writing out your task list, then translating that list into pseudocode, then gradually developing that pseudocode into actual, computer-readable code.


Use white space and indentation effectively, pseudocode how to write discount. Using white spaces between pseudocode how to write discount of text will help keep different components of your pseudocode isolated, and indenting different pieces of each block will indicate that those pieces of pseudocode go under a less-indented section.


For example, a section of pseudocode that discusses entering a number should all be in the same "block", while the next section e. Capitalize key commands if necessary. Depending on your pseudocode requirements or the environment in which you're publishing the pseudocode, you may need to capitalize commands that will remain in the actual code. For example, if you use "if" and "then" commands in your pseudocode, you might want to change them to read "IF" and pseudocode how to write discount e.


Write using simple terminology. Remember, you're writing about what the project will donot summarizing the code itself. This is especially important if you're writing pseudocode to serve as a demonstration for a customer who doesn't know coding, or pseudocode how to write discount a project for a beginner programmer.


Keep your pseudocode in the proper order. While the language you use to modify your pseudocode should be simple, you still need to keep each piece of your pseudocode in the order in which it needs to be executed. Pseudocode how to write discount nothing to the imagination. Everything that is happening in the process must be described completely.


Pseudocode statements are close to simple English statements. Pseudocode does not typically use variables, but instead describes what the program should do with close-to-real-world objects such as account numbers, names, or transaction amounts.


Even if there is no standard for pseudocode, it will be easier for other programmers to understand your steps if you use structures from existing sequential programming languages, pseudocode how to write discount.


Organize your pseudocode sections. If you have large sections of pseudocode that define other pieces of pseudocode within the same block, you may want to use brackets or other identifiers to keep everything contained. Brackets—both standard e. You can use this same method when writing pseudocode to leave notes that don't fit into the coding text.


Double-check your pseudocode how to write discount for readability and clarity. You should be able to answer the following questions by the end of the document: Would this pseudocode be understood by someone who isn't familiar with the process? Is the pseudocode written in such a way that it will be easy to translated it into a computing language? Does the pseudocode describe the complete process without leaving anything out?


Is every object name used in the pseudocode clearly understood by the target audience?




Pseudo Code Example

, time: 12:11





Isaac Computer Science


pseudocode how to write discount

WRITE A PSEUDOCODE TO FIND THE SUM OF THREE NUMBERS. begin numeric nNum1,nNum2,nNum3,nSum display "ENTER THE FIRST NUMBER: " accept nNum1 display "ENTER THE SECOND NUMBER: " accept nNum2 display "ENTER THE THIRD NUMBER: " accept nNum3 nSum=nNum1+nNum2+nNum3 display "SUM OF ALL THREE NUMBERS: " nSum end. blogger.comg: discount Feb 18,  · Pseudocode is a programming tool that helps programmer design the problem before writing the program in a programming language. It is a detailed and easily understandable description of steps of algorithms or a program, which does not use any programming concepts, rather uses natural blogger.comg: discount UNIT_COST = 5 DISCOUNT_RATE = VAT_RATE = INSURANCE_RATE = 2 FUNCTION calculate_amount_due (square_metres, long_term_customer, insured_value) standard_cost = square_metres * UNIT_COST IF long_term_customer == True THEN discount = standard_cost * DISCOUNT_RATE standard_cost = standard_cost - discount ENDIF vat = standard_cost

No comments:

Post a Comment