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% (12 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.
-
One year ago you bought a stock for $38. 12. Yesterday, the stock paid you a dividend of $4.25. Today, you sold the stock for $51.89. What percentage return did you make on your investment? 1)
-
Can you conclude that the quality varies among shifts? Use the = 0.01 level of significance. Exercises 79 refer to the following data: At an assembly plant for light trucks, routine monitoring of...
-
Historically, technology firms have been the most aggressive users of stock-based compensation in the form of stock options granted to almost all employees of the firms. What is the rationale for...
-
Analyze Threats of New Entrants to the Market Objective: Perform a Porter's Five Forces analysis on the automotive industry. In order to make your recommendation about a new industry for diversifying...
-
Alexander Smith and his wife Allison are married and file a joint tax return for 2019. The Smiths live at 1234 Buena Vista Drive, Orlando, FL 32830. Alexander is a commuter airline pilot but took 6...
-
Define operator precedence and operator associativity.
-
State your own arguments for and against allowing mixed-mode arithmetic expressions.
-
If PetCo had net sales of $600,000, goods available for sale of $450,000, and cost of goods sold of $375,000, what is its gross margin? What amount of inventory will be shown on its balance sheet?
-
What should I expect to spend on marketing this next quarter? I know paid media includes television, radio, magazines, newspapers, outdoor, direct mail, in-store media, online banner ads, videos,...
-
On November 15, a fire destroyed Youngstown Inc.'s warehouse where inventory is stored. It is estimated that $12,000 can be realized from sale of usable but damaged inventory. The accounting records...
-
As part of the marketing team for a new ice cream manufacturer, develop a consumer sales promotion and trade sales promotion plan for your product. Use at least two consumer sales promotion and two...
-
Refer to Gelos' ICT Maintenance Procedure, ICT Support Service Level Agreement and Standard Operating Environment for the procedures to follow for this part of the assessment. Task 1 Two Gelos staff...
-
Additional details for methods in each class: You are required to implement the following method in each class, following its respective description Person Class Appropriate getter and setter...
-
Le Chateau Inc. and Reitmans (Canada) Limited are two competitors in the retail clothing industry. They reported the following information at January 29, 2011 (in millions of dollars): Industry...
-
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.
-
How would each leadership style ( transactional leadership and transformational leadership) approach communication with various stakeholders?
-
Explained the different type of leader -Great man -trait theory -skill theory -behavior theory -Contingency theory (situational) -Transformation transactional leadership -transactional leadership...
-
What effect will a corporation's emphasis on environmental responsibility have on its financial performance in both the short term and long term? Does this contradict the notation of maximizing the...
Study smarter with the SolutionInn App