Which statement is equivalent to the following?

number = number * 2;

a. number = pow(number, 2);
b. number *= 2;
c. number = number * number;
d. number * 2 = number;
e. None of these


b. number *= 2;

Computer Science & Information Technology

You might also like to view...

According to the POSIX specification, processes send signals by specifying a ________.

a) thread identifier b) process identifier c) pointer to a process control block d) any of the above are allowed

Computer Science & Information Technology

Should the sales support staff ask the IT department to rewrite the user manual as a maintenance project, or should they request more training for sales staff? Can you offer any other suggestions?

What will be an ideal response?

Computer Science & Information Technology

Exercise 8.3 asked you to write a series of single statements. Actually, these statements form the core of an important type of file-processing program, namely, a file-matching program. In com- mercial data processing, it is common to have several files in each application system. In an accounts receivable system, for example, there is generally a master file containing detailed information

about each customer, such as the customer’s name, address, telephone number, outstanding balance, cred- it limit, discount terms, contract arrangements and, possibly, a condensed history of recent purchas- es and cash payments. As transactions occur (e.g., sales are made and cash payments arrive), they are entered into a file. At the end of each business period (a month for some companies, a week for others and a day in some cases), the file of transactions (called trans.txt in Exercise 8.3) is applied to the master file (called oldmast.txt in Exercise 8.3), thus updating each account's record of purchases and payments. During an updating run, the master file is rewritten as a new file (newmast.txt), which is then used at the end of the next business period to begin the updating process again. File-matching programs must deal with certain problems that do not exist in single-file pro- grams. For example, a match does not always occur. A customer on the master file might not have made any purchases or cash payments in the current business period, and therefore no record for this customer will appear on the transaction file. Similarly, a customer who did make some pur- chases or cash payments may have just moved to this community, and the company may not have had a chance to create a master record for this customer. Use the statements from Exercise 8.3 as a basis for writing a complete file-matching accounts receivable program. Use the account number on each file as the record key for matching purposes. Assume that each file is a sequential file with records stored in increasing order by account number. When a match occurs (i.e., records with the same account number appear on both the master and transaction files), add the dollar amount on the transaction file to the current balance on the master file, and write the newmast.txt record. (Assume purchases are indicated by positive amounts on the transaction file and payments are indicated by negative amounts.) When there is a master record for a particular account but no corresponding transaction record, merely write the master record to newmast.txt. When there is a transaction record but no corresponding master record, print the error message "Unmatched transaction record for account number ..." (fill in the account number from the transaction record). What will be an ideal response?

Computer Science & Information Technology

Give an example of a function that would be a good candidate to only utilize variables passed by value.

What will be an ideal response?

Computer Science & Information Technology