Objectives Compare the readability, writability, reliability, and cost criteria
ID: 3749806 • Letter: O
Question
Objectives Compare the readability, writability, reliability, and cost criteria of three programming languages (PLs): C++, Java, and Python. Programming Requirements Write a program in C++, Java and Python that prompts the user of the program to enter two integer values then the program computes &displays their sum. Submission Requirements Using the default Windows' compression or zipping, as I showed you in class, provide the following files in a zip folder: 1. The source codes (3 of them, one for each PL). Make sure you provide each program file with the proper extension: .cpp for C++, .java for Java, and py for Python. I should be able to run each program without any problem. Each program should compile, run, and accomplish its purpose as described above in the Programming Requirements. Name each program as follows: YourLastnameFirstnameAssignmentl with the example, I would name my C++ program as: KouroumaMathicuAssignment.cpp Notice that there is no spacing. DO NOT copy and past your programs in a Word document. These source codes should be in a text editor (Notepad++ for example as I recommended) or a text editor which is part of an integrated development environment (IDE), such Microsoft Visual Studio, NetBeans, etc. proper extension. For 2. The outputs of your program execution in each PL in this assignment file in the sections provided below. There should be three (3) different screen shots one for each program run/execution. Provide or take the screenshots as I showed you in class. . Compare three PLs in terms of readability, writability, reliability, and cost. Provide your answer to this question in this assignment file in the specified section provided below 4. For Parts 2 and 3, you use this Word document file. Rename this file as: YourLastnameFirstnameAssignment1. For example,, I would name my Word document file as: Kourouma MathieuAssignment. In total, you should have four (4) files (3 program files and 1 Word file) in the zip folder. Name your zip folder as: YourLastnameFirstnameAssignment. For example, , I would name my zip folder as: KouroumaMathieuAssignmentl. Keep in mind that you are required only one submission in Moodle and you will allowed to submit ONLY a .zip folder. As a result, you are required to zip all the four (4) files.Explanation / Answer
Python:
Code:
num1 = input("Number 1 is : ")
num2 = input("Number 2 is : ")
sum=num1+num2
print "Sum of num1+num2 =", sum ;
Output:
Number 1 is :5 Number 2 is :3 Sum of num1+num2 = 8
Java:
Code:
public class Chegg {
public static void main(String[] args) throws ParseException {
Scanner in=new Scanner(System.in);
System.out.println("Enter first number");
int num1=in.nextInt();
System.out.println("Enter second number");
int num2=in.nextInt();
System.out.println("The Sum is "+(num1+num2));
}
}
Output:
Enter first number
3
Enter second number
5
The Sum is 8
C++
Code:
#include <iostream>
using namespace std;
int main()
{
int num1,num2;
cout<<"Enter first number";
cin>> num1;
cout<<"Enter second number";
cin>> num2;
int sum=num1+num2;
cout<<"Sum:"<<sum;
return 0;
}
Output:
Enter first number 5
Enter second number 3
Sum:8
From all perspectives you can see that python is best language as you don't have to import any library(reliability),statements are like simple english(readability and writability).
Now in modern days because of this Python is most popular and useful language used for data science AI and Machine Learning.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.