Rewrite the program of Programming Exercise 1 in C++, Java, and C#, run them, and compare the
Question:
Rewrite the program of Programming Exercise 1 in C++, Java, and C#, run them, and compare the results.
Data from Programming Exercise 1
Run the code given in Problem 13 (in the Problem Set) on some system that supports C to determine the values of sum1 and sum2. Explain the results.
Data from problem 13
Transcribed Image Text:
Let the function fun be defined as int fun (int*k) { *k += 4; return 3* (*K) 1; } Suppose fun is used in a program as follows: void main() { int i = 10, j 10, j = 10, suml, sum2; sum1 = (1/2) + fun (&i); sum2 = fun (&j) + (j / 2); } What are the values of sum1 and sum2
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (10 reviews)
C include int funint k k 4 return 3k 1 int main int i 10 j 10 sum1 sum2 su...View the full answer
Answered By
Churchil Mino
I have been a tutor for 2 years and have experience working with students of all ages and abilities. I am comfortable working with students one-on-one or in small groups, and am able to adapt my teaching style to meet the needs of each individual. I am patient and supportive, and my goal is to help my students succeed.
I have a strong background in math and science, and have tutored students in these subjects at all levels, from elementary school to college. I have also helped students prepare for standardized tests such as the SAT and ACT. In addition to academic tutoring, I have also worked as a swim coach and a camp counselor, and have experience working with children with special needs.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Rewrite the program of Table 4.1 to eliminate all array variables.
-
Let the function fun be defined as Suppose fun is used in a program as follows: What are the values of sum1 and sum2 a. Operands in the expressions are evaluated left to right? b. Operands in the...
-
Rewrite the C program segment of Programming Exercise 4 in Java without using a switch statement. Data From Exercise 4: Consider the following C program segment. Rewrite it using no gotos or breaks....
-
DFI of real sequences with odd harmonics only Let x(n) be an N -point real sequence with N-point DFT X(k) (N even). In addition, x(n) satisfied the following symmetry property: x(n + N/2) = -x(n) n =...
-
How does the interpretation of the regression coefficients differ in multiple regression and simple linear regression? Discuss.
-
Terminology, Relationships, Computations, Entries Instructions Complete the following statements by filling in the blanks. (a) In a period in which a taxable temporary difference reverses, the...
-
Discuss the importance of the verification process and outline its key components.
-
Six-month T-bills have a nominal rate of 7 percent, while default-free Japanese bonds that mature in 6 months have a nominal rate of 5.5 percent. In the spot exchange market, 1 yen equals $0.009. If...
-
JAVA: The Swedish Chef is a puppet character from the Muppet Show. He spoke in his own language. The language is a combination of English, mock-Swedish and nonsense. Your task is to create an English...
-
Imagine two spacecraft are in identical orbits, one behind the other. I am in the Starship Enterprise with Captain James T. Kirk. You are in a transport vehicle, the Heron, trailing the Starship...
-
Define operator precedence and operator associativity.
-
State your own arguments for and against allowing mixed-mode arithmetic expressions.
-
What makes innovation important for Worldwide? Following the hacking incident, how might bureaucracy be expected to interfere with innovation? How should Worldwide engage in "bureaucracy busting?"
-
Dianna Mark is the chief financial officer of Antiliaro, a relatively mature textile production company headquartered in Italy. All of its revenues come from Europe, but the company is losing sales...
-
Describe how each of the following common characteristics of institutional investors supports the Funds allocation to private real estate: i. Scale ii. Investment horizon iii. Governance framework...
-
Discuss the advantages and the disadvantages of the investment approach currently being used by the Investment Committee. Bern Zang is the recently hired chief investment officer of the Janson...
-
Discuss whether the current investment policy is appropriate given the Endowments annual spending policy. Upon completion of the investment policy review by her four-person staff, the CIO makes some...
-
Meura Bancorp, a US bank, has an equity capital ratio for financial assets of 12%. Meuras strategic plans include the incorporation of additional debt in order to leverage earnings since the current...
-
In January 2017, the management of Stefan Company SE concludes that it has sufficient cash to permit some short-term investments in debt and share securities. During the year, the following...
-
Should U.S. antidumping laws be stated in terms of average total costs or average variable costs?
-
What is meant by the term route aggregation? Why is it useful for a router to perform route aggregation?
-
What is meant by a plug-and-play or zeroconf protocol?
-
What is a private network address? Should a data-gram with a private network address ever be present in the larger public Internet? Explain.
-
The government standard on radiation from electrical devices is 10mW/cm2 (maximum). Assume a laptop computer is found to radiate more than this standard. The electric field inside is measured to be 5...
-
A 2 2 . 8 - m deep pool is filled with oil of density 8 9 5 kg / m ^ 3 . What is the gauge pressure at the bottom of the pool? Part B: What is the force from the okl that exerts on a 0 . 3 5 m x 0 ....
-
Clark was driving his four-wheeler 15 meters per second on a dirt road. It had just rained and there were massive mud puddles on the road. He hits on and it slows him to a speed of 3.7 meters per...
Study smarter with the SolutionInn App