Csc 407/507 Homework #1 (chapter 1, 2 and 15) Due Date: Wednesday, June 9



Download 6.67 Kb.
Date28.01.2017
Size6.67 Kb.
#9057
CSC 407/507 Homework #1 (chapter 1, 2 and 15)

Due Date: Wednesday, June 9


All answers MUST be word processed to receive credit. Undergraduates answer one of questions 4 and 5, and any 3 others. Graduate students answer all questions. Note: briefly explain means that your explanation should be about 1-2 sentences in length but should be clear and support your answer.


  1. For the 9 criteria in table 1.1 on page 8, provide a comparison between C and Java. For instance, which of the two languages has better support for abstraction? Provide a brief explanation for each criterion even if you feel that C and Java are equal. Next, given your comparison, which language is more readable? Which is more writable? Which is more reliable? Do your conclusions based on your comparison match your own judgment about the two languages’ readability, writability and reliability?




  1. Come up with 4 examples in the C programming language (not C++) that demonstrate an aspect of the language that makes it more writable but less readable. Each example should demonstrate a different aspect of the language.




  1. The creation of FORTRAN was a leap in technology for computing because it showed that high level languages and compiler technologies were not only possible, but also could provide very efficient machine code. Each of the following languages was also a great leap forward in programming language development. Briefly explain what contribution(s) the language made:

    1. COBOL

    2. Algol 58/60

    3. PL/I

    4. Java

    5. C#

    6. Python




  1. Rewrite the following C function in FORTRAN IV as best you can.

int question(int a, float b) {

int c = a / 3;

if(b > 1.1) {

c++;


a *= c;

}

else if(b < 0) a = 5;



else a = 0;

return a;



}


  1. Rewrite the COBOL program on pages 63-65 in C, C++ or Java. Assume that the input file is called “balance_fwd_file.dat” and the output file is “reorder_listing.dat”. For the input file, assume each record is on a single line (this means that you have to know how much to read in for each entry in the record). Assume that the input is formatted to match what is expected by the COBOL program, so inputs are separated by blank spaces. This should simplify input in C/C++. Your output should be formatted as per the REORDER-LINE formatting in the COBOL program.


Download 6.67 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page