Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

problem 1: Here is a short program. This prints out the value of a variable "x". Ernie and Bert disagree about what will be printed: Ernie says, the value gets changed in "changeX" so it will print "7", and Bert says, no, when the function exits the changes get reversed and the value goes back to "5". describe who is correct and why.

int x = 5;
void draw()
{
   changeX();
   print(x);
}
voidchangeX()
{
   int x = 7;
}

problem 2: prepare out pseudocode for a function called "and" that takes two arguments, both booleans, and returns the logical and of the inputs. DO NOT use the logical and operator: instead, prepare out if statements that cover the possibilities.

problem 3: You are going to prepare a function that computes the total interest charged on a credit card before it is paid off. List all the inputs the function will need.

problem 4: prepare a function that draws a cow at a certain location on the screen, and use the function to draw a herd of cows (at least 10).

problem 5: prepare a function that takes an array as the argument and returns the second largest element. Bonus (+5): prepare a function that takes an array and a number n as arguments and returns the nth-largest element. (So if n = 5, it returns the fifth largest.)

problem 6: prepare a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

problem 7: prepare a function to determine whether a number is prime: it will return true if the input is prime and false otherwise. Use it to see whether -7 is prime.

problem 8: Create an array of Strings and fill it with some interesting text, such as vacation destinations, album names, or weapon names from a CRPG. Display three elements of the array on the screen at a time; allow the user to scroll through the list with keypresses (e.g., 'a' to advance the list, 's' to go back).

problem 9: prepare a function that takes in a number n and divides the screen into n vertical bars, alternating black and white. (What should you do if someone puts in n = 0 or n = -99?)

problem 10: prepare a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91240

Have any Question? 


Related Questions in Computer Engineering

1 explain the difference between an object and an object

1. Explain the difference between an object and an object reference. 2. Explain the difference between an object and an object variable. 3. Explain the difference between an object and a class. 4. Give the Java code for ...

Assume router r2 in figure 1835 receives a packet with

Assume router R2 in Figure 18.35 receives a packet with destination address 140.24.7.42. How is the packet routed to its final destination?

1 is creating a timeline more important for the design of

1. Is creating a Timeline more important for the design of the project then for actually coding it? How so? 2. Is it possible to translate a feature, like Panorama, that uses multiple screens in a desktop environment, to ...

Get the instructions for last years form 1040 from

Get the instructions for last year's form 1040 from http://www.irs.ustreas.gov. Find the tax brackets that were used last year for all categories of taxpayers (single, married filing jointly, married filing separately, a ...

1 prove that any file in the dgux system with a link count

1. Prove that any file in the DG/UX system with a link count greater than 1 must have an explicit MAC label. 2. In the DG/UX system, why is the virus prevention region below the user region? 3. In the DG/UX system, why i ...

1 for a system without a dmz where is the best area in the

1. For a system without a DMZ, where is the best area in the network to install a honeypot? 2. Why are honeypots important to a network? Discuss the disadvantages of having a honeypot in the network. 3. Discuss three app ...

Programmingnbsp write the following programs using c

Programming:  Write the following programs using C language. Each program shoulddate of creation on the top (use comments). Write a clear and properly indented code and use comments properly. 1. Simple if statement progr ...

1 a certain two-input gate computes the exclusive-or

1. A certain two-input gate computes the exclusive-OR function using negative logic. What function does the same gate compute using positive logic? 2. Is there a Boolean function that cannot be realized using only AND an ...

Write a program that compares all four advanced sorting

Write a program that compares all four advanced sorting algorithms discussed in this chapter. To perform the tests, create a randomly generated array of 1,000 elements. What is the ranking of the algorithms? What happens ...

Term paper reengineering the course enrollment

Term Paper: Reengineering the Course Enrollment Process Consider Strayer University's current process of enrolling for courses through the use of the Web. Suppose that the University has contracted you to reengineer the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro