What is the problem with using high-level programming languages to represent algorithms

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Asked by digagimami on coursehero.com

What are some of the ways pseudocode overcomes the problems with natural language and high-level programming languages in regards to representing algorithms? How are they more or less efficient than natural languages and high-level programming languages?

Answered by singh_neha on coursehero.com

um dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, c

What is the problem with using high-level programming languages to represent algorithms

Unlock access to this and over
10,000 step-by-step explanations

Unlock Explanation

Have an account? Log In

Step-by-step explanation

um dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar t

It is rare for programmers to write programs directly in machine language or assembly. The executable files for most applications contain hundreds of thousands or even millions of machine language instructions. It would be very hard to create something like that from scratch.

High level programming languages were invented to abstract away the details of machine code and help programmers to concentrate on problem solving. While it might take 3 or 4 lines of code to add two number using assembly language, this task could be accomplished with a single instruction in a high level programming languages like C++, Java or Python. With a high level language, a programmer creates a program using powerful, “big” operations which will later be converted into many little machine operations.

Programs written in a high level language must be converted into machine code to run. This is either done ahead of time by converting a whole program to machine code with a compiler program (compiling the code), or line by line as the program runs by an interpreter. One line in a higher level programming language might turn into anywhere from one to dozens or more machine instructions. Not only does that mean there is less code to type, but it also means there is less code to debug - when something goes wrong, it is often easier to track down.

What is the problem with using high-level programming languages to represent algorithms

The tabs below show what code might look like in various language levels. Imagine we are designing software for the sales terminal in a restaurant; we are going to look at the part of the code that might calculate the 15% tip that is automatically added to large groups. (Note: all the languages are made up representatives of a particular level - don’t worry about the details of each.)

To calculate the total amount owed, first multiply the total price of the meal by 0.15. This gives you the tip for the meal. Then, add that to the price of the meal to find the total bill.

tip = mealCost * 0.15
bill = mealCost + tip

LOAD    MealCost
MULT    TIPRATE
STORE   Tip
LOAD    MealCost
ADD     Tip
STORE   Bill

0101010111100101
1111011010101110
1101101010010101
0101110110001111
0001010101111100
1101101010111111

Note that the high level language is much more compact than the assembly or machine code and, even more important, it allows us to express an algorithm at a level much closer to the actual problem domain. Instead of worrying about LOADing and STOREing values into registers, we can express commands that look more like normal calculations: tip = mealCost * 0.15.

You have attempted of activities on this page

What are some disadvantages to programming in a higher level language?

Comparative Table for Advantages and Disadvantages of High-Level Language.

What is the limitation of high

It is concluded that high-level languages are too slow and that execution times are too variable for critical timing in experiments. On the other hand, machine language programs can provide the needed precision and control.

Why are high

High-level programming languages are problem-oriented rather than machine-oriented. This means that high-level languages are typically designed to handle a particular problem, whereas low-level languages are designed to run on particular devices.

Which of the following are the advantages of using a high level programming language as opposed to a machine language?

Which of the following are the advantages of using a high-level programming language as opposed to a machine language? It is easier to write programs. It is easier to read and understand programs. Programs can run more efficiently.