Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Compare and contrast these three different programming languages: Fortran, C, an

ID: 3770223 • Letter: C

Question

Compare and contrast these three different programming languages: Fortran, C, and Java

More specifically, compare how the different languages support different program features. You don't have to go into complex features, just features needed to write a simple program that does tasks such as these:

Prompt the user for three non-integer numbers. Print the value of the largest, smallest, and the average.

Prompt the user for a string. Print the number of characters in the string.

Prompt the user for the diameter of a circle. Print the area and circumference using appropriate math functions in the calculation.

Note: You don't need to write code for the three points above.

Discuss how each of the three programming languages make simple tasks like the ones above more simple or more difficult to write. Also, what additional features you think the language needs.

List as many points as possible

Explanation / Answer

1. In all three languages logical part is same but the way of writing is different i.e declarations of all the data types, methods,initialisation of variables.

2. For example in Fortran integer declaration is INTEGER A B C.

3. The statement in c and Java is different - int a,b,c;

4. Every statement should be end with semicolon in c and Java but it is not exist in Fortran.

5. Declarations of variables and methods are same in c and Java. But Java has more features compare to c.

6. C is structured language and Java is object oriented language. Without class and object we can not write Java program.

7. Now we will see variation of the given programs.

8. In first program take three floating numbers and calculate the average of three. Logic is same for all three languages. For example a,b,c are three floating numbers. Average is (a+b+c)/3. But the way of writing is different. In Fortran it is FLOAT A B C. In c and Java it is float a,b,c;

9. In the next program, read the string and split into individual characters. Declaration is different.

10. In the next program diameter means 2r. That is indirectly we get the radius of circle, we can calculate area and circumference.

11. Java supports inheritance, interfaces, abstract classes, exception handling etc these are not in c.

12. Java is both compiler and interpreter language but c is compiler language.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote