Examples of pseudocode containing control structures

Assignment Help Data Structure & Algorithms
Reference no: EM13945457

The following are a few examples of pseudocode:

>> Example 1

start

read Customer_Order_Record
if Quantity > 100 then

Discount = 20

else

if Quantity > 12 then

Discount = 10

endif

endif

Total = Price* Quantity
Total = Total - (Discount* Total)/100
Print Total

Stop

>> Example 2

Start

Read Student_Marks_File
Pass = 0
Fail = 0
Total = 0
X = 0
while (End Of Student_Marks_File) do

Total = Total + Subject_Marks

if (Subject_Marks > 40) then

Print "Student passed in" Subject

else

Print "Student failed in" Subject

endif
X = X +1
Read Next Record

endwhile
Average = Total/X
Print "Average Marks of" Student_Name "are" Average

Stop

From the above examples of pseudocode containing control structures, analyze the logic implemented in the pseudocode.

Reference no: EM13945457

Questions Cloud

What racial tensions existed in the early church : What racial tensions existed in the early church? How are they resolved? Is a quota system used here to pacify the Grecian Jews? Is this a form of affirmative action?"
Design a class named productionworker that extends employee : The workday is divided into two shifts: day and night. The shift field will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Design the appropriate accessor and mutator ..
Illustrate your answer by referring to specific brands : Illustrate your answer by referring to specific brands within each of the two product categories you have chosen.
What principles of statutory interpretations were utilized : What principles of statutory interpretations were utilized by the Court in this case - Explain in plain English the implications of Australian Maritime Officers'
Examples of pseudocode containing control structures : From the above examples of pseudocode containing control structures, analyze the logic implemented in the pseudocode.
Create a flowchart and pseudocode using control breaks : The system should store the current inventory levels for different raw materials in a file.
Both fishing method and the range of fishing operation : describe the development which have taken place during recent years in both fishing method and the range of fishing operation
Loss on the abandonment : Loss on the abandonment of office equipment $25,000 Loss on the sale of a building
What disciplines are essential for spiritual growth : What does Scripture and current research say about the role of apostles, prophets, evangelists, shepherds, and teachers in church multiplication?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Maekawa''s algorithm

Maekawa's Algorithm is used to achieve mutual exclusion for 13 sites. Suppose the sites are labeled 1, 2, ..., 13. Find the request sets R1, R2, ... , R13. Suppose sites 1, 6, 12 want to enter a critical section ( CS ) and they have sent requests in ..

  Efficient algorithm for computing single-source

Give an efficient algorithm for computing single-source shortest paths in an undirected graph G for which edge weights are 1 or 2. Describe all data structures needed to support your algorithm. What is the runtime of your algorithm?

  Plot six training points in a two-dimensional space

how many examples do we need to exhaustively enumerate every possible combination of inputs -  what is the conditional probability that An item classified as Reject is actually good?

  Sorting arrays of name in descending order

Then sort arrays so that records are in descending order by purchase amount for month. Output lists the names of the top five customers.

  Currency conversion development

Currency Conversion Development

  How to sort an array using insertion sort

How to sort an array using insertion sort and track teh number of swaps during the sorting - Can someone provide the answer with reference to data structure?

  Process of insertion into a heap-implemented priority queue

Explain the process of insertion into a heap-implemented priority queue, and informally explain its complexity and the process of removal from a heap-implemented priority queue, and informally explain its complexity.

  Write algorithm by using pseudo code consensus algorithm

Write the algorithm, by using pseudo code, "Consensus algorithm": A group of ten people require to decide which one flavor of ice cream they will all order, out of three options.

  Discuss infix to postfix conversion

This part will use both a stack and queue in order to convert expressions from infix to postfix notation.

  Optimal parenthesization of a matrix-chain product

Use the dynamic programming technique to find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is

  Create a program that implements each mergesort an quicksort

Create a program that implements each mergesort and quicksort. For each the program should generate an array of 500 numbers in the range of 1-100.

  Describe the worst case scenario for quick sort algorithm.

Any ideas to improve the worst case? Comment on the improvement in running time vs. increase in code complexity.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd