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

Remember from the beginning of this book how amys day

Remember from the beginning of this book how Amy's day started? Now imagine how it could have been: For Amy, the day began like any other at the Sequential Label and Supply Company (SLS) help desk. Taking calls and helpi ...

Visit the nist web site and view the document announcing

Visit the NIST Web site and view the document "Announcing the Advanced Encryption Standard (AES)" which can be found at http://csrc.nist.gov/publications/fips/ fips197/fips-197.pdf. Review the FIPS-197 standard. Examine ...

Search the world wide web for job descriptions of project

Search the World Wide Web for job descriptions of project managers. You can use any number of Web sites, including www.monster.com or www.dice.com, to find at least ten IT-related job descriptions. What common elements d ...

Investigate the random number generators built into three

Investigate the random number generators built into three of your favorite programming languages. Would you use these random number generators for cryptographic purposes? Using an existing cryptography library, write a s ...

Copy the following drawing and label the lines using the

Copy the following drawing and label the lines using the vertex classes and line labels discussed in Section 6.5.1. if there is more than one consistent labeling, show as many as you can think of, and describe a physical ...

Design and implement a merging algorithm that uses only two

Design and implement a merging algorithm that uses only two arrays. It can be assumed that the sizes of the two data sets are known in advance. An interesting way to do this is to place the array with the biggest element ...

Design a combination generation algorithm that accepts as

Design a combination generation algorithm that accepts as input a set of n characters and produces as output all combinations of size r of these characters.

Dta interpretation research reportyour task write a

Data Interpretation Research Report Your task: Write a report on the statistical relationship that you find between the stock price of the company that you have been assigned and the following three variables: the FTSE, ...

Analyze the hersheys enterprise system creates halloween

Analyze the Hershey's Enterprise System Creates Halloween Tricks caseNew Window. Prior to the Year 2000 transition, Hersey's Corporation planned a major systems project to implement a new ERP system. While the case is no ...

1 you want to write a program in which you need to refer to

1. You want to write a program in which you need to refer to the InetAddress of the computer you are working with. Write a statement in Java to create the corresponding object. 2. You want to create all InetAddress objec ...

  • 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