Week 2 Homework Comp122

Page 1 of 1 - About 3 Essays
  • Premium Essay

    Week 2 Homework Comp122

    COMP122 Week 2 Homework Complete the following problems. 1. Suppose you are given the following variable declarations: int x, y; char ch; What values (if any) are assigned to x, y, and ch after each of these statements execute? Assume that the input to each statement is the same: 5 28 36 a. cin >> x >> y >> ch; a) x = 5, y = 28, ch =3 b. cin >> ch >> x >> y; b) x = 28, y = 36, ch = 5 c. cin >> x >> ch >> y; c) x = 5, y = 8, ch = 2 d. cin >> x >> y;

    Words: 300 - Pages: 2

  • Premium Essay

    Comp122 Assignment

    COMP122 Week 1 Homework Part 1: Complete the following problems. (13 points) 1. What is machine code? Why is it preferable to write programs in a high level language such as C++? (2 points) Machine code is a computer programming language that a computer hardware can understand and respond to. It is much easier to understand machine language and learn how to write programs using C++. 2. What does a compiler do? What kinds of errors are reported by a compiler? (1 point) A compiler helps

    Words: 805 - Pages: 4

  • Free Essay

    Electrical Engineering

    COMP122 Week 1 Homework Part 1: Complete the following problems. 1. What is machine code? Why is it preferable to write programs in a high level language such as C++? A machine code is consisting of a low level programming language that is executed by CPU. Writing a program in C++, a computer translate the C++ code in the machine code for the CPU to understand. 2. What does a compiler do? What kinds of errors are reported by a compiler? Compiler help translate high level programming

    Words: 1021 - Pages: 5

Previous
Page   1
Next