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 discuss the steps you would take to protect your mobile

1. Discuss the steps you would take to protect your mobile device. 2. Search the Internet to find a company's security policy for its mobile devices. Suggest what you would change in that security policy to enhance secur ...

1 assume that you have 1 ss cpu how many cycles will it

1. Assume that you have 1 SS CPU. How many cycles will it take to execute these two threads? How many issue slots are wasted due to hazards? 2. Now assume you have 2 SS CPUs. How many cycles will it take to execute these ...

Consider a directed random graph of the kind discussed in

Consider a directed random graph of the kind discussed in Section 13.11. a) If the in- and out-degrees of vertices are uncorre1ated, i.e., if the joint in/outdegree distribution P jk is a product of separate functions of ...

In el farol extension 3 we now graph the actual award

In El Farol Extension 3, we now graph the actual award distribution using a histogram. Another common way of displaying wealth distributions like this is to use a cumulative distribution function, where the y-value at an ...

The prolog interpreter as described in this chapter

The PROLOG interpreter, as described in this chapter, performs a prescribed resolution at each step. If all of the statements in a PROLOG program were con-verted to disjunction of literals, describe a control strategy fo ...

Using the internet research wireless lan applications

Using the Internet, research wireless LAN applications. Compile a list of at least five applications that you had not imagined before for WLANs, and write a one-paragraph description below each one. The paragraph should ...

The random class implements a random number generator which

The Random class implements a random number generator, which produces sequences of numbers that appear to be random. To generate random integers, you construct an object of the Random class, and then apply the nextInt me ...

Al was an attorney in a small town and was very well

Al was an attorney in a small town and was very well respected. A couple retained Al to represent them on the purchase of a home. Before closing, Al informed the couple of payments that they were required to make by chec ...

Based on the design requirements and decisions that have

Based on the design requirements and decisions that have been made, what routers would you recommend for Klamath? Do some Internet research to find a router that will meet Klamath's needs and write two or three paragraph ...

After her meeting with charlie iris returned to her office

After her meeting with Charlie, Iris returned to her office. When she had completed her daily assignments, she pulled out a notepad and began to make some notes about the information security position Charlie had offered ...

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen